How to get rid of that pesky GUID in your PowerApp

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 SharePointDynamics or some other connection that you have made. But why do the Lookup columns or fields display the GUID?

GUID example

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.”

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.

Choose your data source

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.

Connections - dataset

In this scenario I am connecting to “Opportunities” from our production environment of Dynamics 365.

Opportunities from Dynamics

4. Your app will be built automatically by PowerApps! Sit back and relax…for the time being.

Building your app

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.

GUID

 

 

 

 

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.

Data 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.

Add Data Source Add Accounts  Add data

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.

Account lookup

7. Now, do the same for contacts – and there you have it!  No more GUIDs!

Account Lookup 2

Author: Bernie Thibeault

What I love most about Dynamics 365 is how it streamlines processes for businesses of all sizes. Every organization is unique, but they all have the same need to get more done in less time. Dynamics 365 is the solution to do that. I'm a skilled listener who knows how to get beneath the surface and hone in on exactly what clients need to get out of Dynamics 365, making him one of the most valuable additions to any team.