The soft iron bar is used as the core of the electromagnet in an electric bell because it has low retentivity and therefore, the bar remains magnetized so long the electric current flows through the solenoid, but it gets demagnetized as soon as the current is switched off.