How to get choice/ optionset/ lookup text in Power Automate flow using Formatted value property.

In this blog, I am going to introduce something which has been really long awaited in Power Automate flows. I am not going to show any workarounds here. Rather some new property introduced in Power Automate which you may not be aware of.

How many of you had the following requirements? Lot of hands raised right?

  • You want to get the text of choice/ optionset field in Power Automate
  • You want to get the primary attribute value of a lookup field in Power Automate.

Let’s take the example of Choice field of DataVerse. We can get the text which is the formatted value of the optionset but it is not straightforward and not very intuitive for citizen developers. We need to use the below expression to get the formatted text value.

'cr444_relationship@OData.Community.Display.V1.FormattedValue'

Here in the above expression, cr444_relationship is the name of the choice/ optionset field.

It was infact worse for lookup fields where we need to get query the lookup record again to get it’s details. While it’s OK to have an additional call to fetch other field information for lookup fields, it’s quite unjustified to make another call even for primary attribute value. Well, no longer the case.

Microsoft have now introduced the formatted value as an additional property from the dynamic content which we can choose from. Let’s see the example below.

How to get choice/ optionset/ lookup text in Power Automate flow

Visit Status is a choice field in the Visit Log table. And you can see, there is an additional field showing up in the Dynamic content Visit status (formatted value). And guess what, it gives the text of the choice.

Ok. That’s about choice. How about the lookup fields. Previously even for the primary attribute value, we need to make an extra call to the lookup table based on it’s ID.

How to get choice/ optionset/ lookup text in Power Automate flow

As you can see in the above screenshot, here also you can use the Formatted value option to get the primary attribute field value of the lookup which is wonderful. Isn’t it?

You will also like the below posts.

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading