Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Rj7RhDB+tLDdoWZG7r6Hlr
Power Automate - General Discussion
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 11 Mar 2020 19:43:07 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

  • WendyLumsden Profile Picture
    56 on 12 Nov 2022 at 09:51:56
    Re: Using Power Automate to update Option sets field's selected value

    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?

     

  • jregalla Profile Picture
    5 on 23 Aug 2021 at 03:08:39
    Re: Using Power Automate to update Option sets field's selected value

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

  • shaboo Profile Picture
    65 on 15 Jun 2021 at 10:38:05
    Re: Using Power Automate to update Option sets field's selected value

    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.

  • ac7 Profile Picture
    19 on 11 Nov 2020 at 00:30:42
    Re: Using Power Automate to update Option sets field's selected value

    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!

  • Reigningfear Profile Picture
    139 on 21 Jun 2020 at 18:50:32
    Re: Using Power Automate to update Option sets field's selected value

    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? 

  • rrelopez Profile Picture
    25 on 12 Mar 2020 at 17:18:49
    Re: Using Power Automate to update Option sets field's selected value

    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

  • yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on 12 Mar 2020 at 06:34:22
    Re: Using Power Automate to update Option sets field's selected value

    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!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started