Add fetch is not working in my case

Hi all,

I am trying to fetch username form User doctype to other docytpe. whenver i link it to User doctype, it is fetching e-mail id of user instead of username from Userdoctype. could you please help on this.

Thanks,

Show name of field in your datatype.

https://erpnext.org/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/custom-script-fetch-values-from-master