The soft iron bar acquires the magnetic properties only when an electric current flows through the solenoid and loses the magnetic properties as soon as the current is switched off. That’s why soft iron is used as the core of the electromagnet in an electric bell.