Contact Details auto populate in Cases

Contact Details auto populate in Cases

Dear Team,

In the mobile CRM App, when user selects contacts in the cases, we like to auto fetch details of address, contact person from the selected contacts. 

We tried applying custom function. However if the internet is off for the user den custom function is not working. 

Please suggest us another solution where it can fetch details offline as well when selected contacts in the cases.