web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using Power Automate t...
Power Automate
Unanswered

Using Power Automate to update Option sets field's selected value

(0) ShareShare
ReportReport
Posted on by 25

Hi,

 

I'm using Power Automate in creating a new record in a CDS entity (my data source is a SharePoint list and the flow gets triggered when an item is created to create the same record in CDS).

But I'm not sure how to map/pass values to an option set field in CDS. As you can see in the screenshot below, I'm using the 'Create a record' action and the highlighted ones are option set fields. For all other fields like text, date, or lookup fields, I am able to browse on the SharePoint items. But for fields that are of type 'Option sets', I'm only seeing the ID. Does someone know what parameter format should I pass to set the selected value of an option set in CDS?

 

Thanks in advance!

 

create a new record.png

not seeing other values.png

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @rrelopez 

     

    Option sets in CDS have integers and labels on top of those. Therefore to pass it dynamically in the flow actions, you first have to navigate to the  CDS entity and then to the option set and note down the numbers assigned to the respective labels. Once done, in Flow, you can first initialize an integer variable and then create a switch action and then get the item from sharepoint, compare the text and set the variable to the respective option set integer value and then pass that variable in the create record action. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • rrelopez Profile Picture
    25 on at

    Thanks for your suggestion @yashag2255. I will try it.

     

    Also, I'm just curious, does anyone know if there's a way to query/extract that specific label's integer instead of hard coding it to a variable integer?

     

    Thanks

  • Reigningfear Profile Picture
    139 on at

    Hello,

     

    I am also curious about this @rrelopez . My use case requires me to know the integer value before updating a record since the data source is an excel with only the label value (text). Are option sets able to be queried like entities? 

  • ac7 Profile Picture
    19 on at

    This is from awhile ago, but I had the same issue with needing to get option set values based on the label, and I found the answer here: https://www.c-sharpcorner.com/article/get-option-set-value-based-on-label-in-microsoft-flow/ 

     

    You can use the CDS "List records" action to query the "String Maps" entity, with a filter like:

     

    objecttypecode eq '{entity}' and attributename eq '{field name}' and value eq '{label string}'

     

    From there you can reference the attributevalue from the returned data to get the int value of the option. Hope this helps!

  • shaboo Profile Picture
    65 on at

    Easy Solution to update option set values from the parent records or related records. 

     

    Example: Updating shipping method option set value from account to quote on creation 

    Shaboo992_2-1623753130105.png

     

    Get the option set values as you normally query as shown above steps

     

    Updating Option set values 

    The trick here is to enter custom value and select the dynamics value from get data step

    Shaboo992_0-1623752944601.png

     

    Sleeting the dynamics value should resolve the issue. The custom value will find the right matching option set value from the source

    Shaboo992_1-1623753003304.png

     

    The alternative solution to this is compose a step to store option set value and then use the output of the compose in a updating option value enter custom value option.

  • jregalla Profile Picture
    5 on at

    after hundreds of hits .. finally found solution here... marvelous

  • WendyLumsden Profile Picture
    56 on at

    Hi Yashag2255 and @Shaboo992 ,

    I have a requirement to update a multichoice field in Dataverse.  I have converted all the labels to the choice codes and, using int(), creating an array of the integer values.
    However I keep getting a message that the input for the dataset options field "are not integers".  I have tried updating the Dataverse field with the array of integers, with a split of the integer array using a comma..... etc. 
    Any experience or can point me in the right direction of updating a multi choice field?  There have got to be user cases out there?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard