Fri, 04/16/2021 - 09:48 By Nguyen Thanh Khoi

How to deal with optionset and lookup values in Power Automate

We usually use the action "Get row" because this action is very common and needed for most cases. However, Have you ever find the simplest way to get the name of the lookup value instead of retrieving it one more time to get the name, this article is for you.

For example, here a have the output of the action "Get row" of a Phone call record. Let focus on the field Regarding. This field is a lookup field in the entity Phone call and it could store various entities such as account, contact, lead, opportunity,...

Most of people will use action "Get row" again to retrieve information of the lookup field then they could get the name of lookup value from the 2nd "Get row" action.

However, we probably could get the name of lookup field from the first action "Get row". Let have look at output:

How to deal with optionset and lookup values in Power Automate

As you can see, the output contains information of lookup value name already. Let's see how to get it:

  • I copy the text of dynamics content "Regarding (Value)" to notepad and it has value:
@{outputs('Get_a_row_by_ID')?['body/_regardingobjectid_value']}
  • then update it to:
@{outputs('Get_a_row_by_ID')?['body/_regardingobjectid_value@OData.Community.Display.V1.FormattedValue']}
  •  I put value directly to component where I want to get value name of field Regarding, we could do the same way to get option set label, multiple optionset, ...
How to deal with optionset and lookup values in Power Automate

we could do the same way with other field like optionset, multiple optionset, ...

Do you have any tricks? Let's comment here

How to deal with optionset and lookup values in Power Automate

Add new comment

Image CAPTCHA
Enter the characters shown in the image.