This is a common problem with PowerApps that isn’t immediately evident to someone who may be a citizen developer. You want to create an app to view or edit the data you have stored in SharePoint, Dynamics or some other connection that you have made. But why do the Lookup columns or fields display the GUID?
It is a simple fix that just takes some experience in PowerApps to Master.
As an example, I will walk through this issue with Opportunities data from Dynamics 365.
1. To start, go to PowerApps and click “Create an App.”
2. From here, you will be asked to choose your data source, if you don’t find your data source, Microsoft might not offer an out of the box app for it. You should still be able to get connected by starting from a blank app or using a Dynamics or SharePoint data source as a template and substituting your data source in for it. I’ll cover this in a later blog.
3. After selecting your data source, you will need to specify what environment this data is in, as well as what table you would like to pull from.
In this scenario I am connecting to “Opportunities” from our production environment of Dynamics 365.
4. Your app will be built automatically by PowerApps! Sit back and relax…for the time being.
After your app has been created, you may notice that some of the fields are an incoherent mix of numbers and letters. This is a GUID and means that there is a lookup field in our data! Not to worry, we can fix this.
This happens because we only are able to specify 1 connection when creating the app, and the lookup values on the opportunity entity stores the GUID for Accounts and Contacts, not the friendly names.
5. To fix this we need to add connections for the Account and Contact entities or tables.
The first step is to click “View” from the top menu of our app and then “Data Sources.” This will flyout a menu with a list of all our sources.
As you can see, “Opportunities” was our only option so we need to click “Add data source.” From there, we can add the Accounts and Contacts from Dynamics 365 as our Data Sources.
6. After adding the Accounts as a data source, now we can go to the PowerApp to edit the field that is using the GUID. To make this a friendly name, we use the Lookup() function to lookup to the Account entity or table. In our scenario, the formula is as follows: Lookup(Accounts, accountid = ThisItem._parentaccountid_value, name).
This formula basically says “Lookup to the Accounts table, where you find a match in the Account ID to this items’ Parent Account ID, return the Name of the Account.” Pretty straight forward, but if this is your first go around with PowerApps – it might not come very easily.
7. Now, do the same for contacts – and there you have it! No more GUIDs!