Get Lookup / Power Automate text value instead of guid / integer values using Power Automate
Problem Statement
In Power Automate flows, I was getting GUID for lookup and integer for optionset fields instead of text values for both fields.
Example
For a contact records below from CRM, I've Account Name as lookup field and Preferred Method of Contact an optionset field.
Solution
To get face values for lookup as well as for optionset, you need to use below expressions
body('SourceDataSet')?['<FieldName>@OData.Community.Display.V1.FormattedValue']
SourceDataSet - the dataset from where you are trying to get face values for optionset and lookup
Field Name - logical field name;
In our case, source data set is "GetContact" while below are fields
Preferred Method of Contact - preferredcontactmethodcode
Account Name (lookup field) - _parentcustomerid_value
So as par above expression, let complete our expression and put in Power Automate Flows Compose component.
For Optionset,
body('GetContact')?['preferredcontactmethodcode@OData.Community.Display.V1.FormattedValue']
For lookup,
body('GetContact')?['_parentcustomerid_value@OData.Community.Display.V1.FormattedValue']
Now in Power Automate flow, the expression will be added for optionset and lookup.
This time when I ran the flow test I got face values instead of GUID or integer.
Preferred Method of Contact
Account Name
~~Enjoy~~
Comments
Post a Comment