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!
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?
after hundreds of hits .. finally found solution here... marvelous
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
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
Sleeting the dynamics value should resolve the issue. The custom value will find the right matching option set value from the source
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.
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!
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?
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
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!
WarrenBelz
146,786
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional