Auto populate field based on relate field

Hi Sugar experts,

I'm trying to auto populate value based on relate field.

Scenario :

1) I have one relate field in opportunities module (with "Contacts" module) that is created in studio.

2) I want to auto populate value from Contacts base on contacts record.

I tried from studio but it is not working. Also I tried with vardef file and it is working fine in web but in mobile edit view it is not working.

Help highly appreciated.

Thanks.