Solution : Refresh the Datasource and then save and publish the app . Detailed description is given below .
Description
I created a power apps with 2 text boxes where i am fetching logged in user’s Business unit and then country where he belongs .
Now , to make it clear
– i am using Dynamics 365 as a data source .
– tables involved , systemuser (User), business unit , country
i added a data source for User’s table .
Approach :
i add a global variable on start on the app where i got the user object based on the logged in user’s email address .I stored it in a variable called D365

I set the value of other 2 text boxes which should have the logged in user’s Business unit ID and country as shown below D365User.'Business Unit'.Country.NameD365User.'Business Unit'.Country.Country

Issue : However when i run the app it shows the data correctly for the 2 textboxes . However when i publish the app it doesn’t show any data .It showed “Getting Data ….” then blank
Solution : click “Refresh” Data source in the data source menu as shown below
then save and publish the app .
