cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mimocnik
New Member

How to handle option sets in Power Automate?

Hello!

 

I have a scenario: Virtual agent sends text to Power Automate (receive it as input) and there I would like to create a new record in Dataverse with filled out Option set. I tested and it doesnt recognize texts but you need to push ID there. I wonder how to say Text A = 100000, Text B = 100001, etc. I was wondering to go with conditions (yes, no) and then drill down but what if there are like 10 values available so it will be really too much IF statements to cover all. If I dont mention what if we get two or more Option sets as inputs from Virtual agent. 

 

Please advise!

1 REPLY 1
Expiscornovus
Dual Super User
Dual Super User

Hi @mimocnik,

 

One approach could be to embed an array with the labels and ids in your flow. You can use a filter array to get the correct id and use an expression in the add row action.

 

Below is an example of that approach. 

Drawback of this approach is that you need to maintain the optionset values in your flow. Alternatively, you could dynamically retrieve the optionset values via an HTTP action instead of the initialize variable action.

 

1. Add an Initialize variable of type array. 

 

2. Add a Filter Array. Filter the array on the label field value.

addresstype_array.png

3. Use an expression to retrieve the correct id of the corresponding label:

 

 

body('Filter_array')[0]['Value']

 

 

 

addresstype_array02.png

 

Hope this helps a bit? 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,905)