Auto fill a field based on another field

Thank you very much. This helped configure my need.

Can you also please point me to similar code which does the below