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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get option set values ...
Power Automate
Answered

Get option set values (D365) to insert row in dataverse

(0) ShareShare
ReportReport
Posted on by 19

Hi community,

 

I'm creating a power automate flow that inserts records in a dataverse table.

 

Challenge: The dataverse table contains fields that are connected to option sets. In order to insert the new row, I've tried to use the text value as custom value, but the execution of the flow is failing. Apparently I need to insert the ID of the value, not the text. In order to do so, I would need to dynamically get the available ID's of the option set, filter them by the one I want to insert, and then proceed adding the row, but I cannot really get access to the ID's of the option set.

 

alextriggle_0-1668615866833.png

 

The trigger of the flow is manual. The user has the option to define the values of each field that needs to be inserted as a row in the table "Touchpoints". As an example, there is a field called "Campaign" that has an option set in the Dataverse. If the user selects "home" in the manual trigger, I try to pass the text "home" as custom value (because I want it to be dynamic for future executions), but flow is asking me to use the ID of the option set for "seat"...

 

The 'inputs.parameters' of workflow operation 'Add_a_new_row' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/trg_campaign' is required to be of type 'Integer/int32'. The runtime value '"home"' to be converted doesn't have the expected format 'Integer/int32'.

 

As a solution, I tried to list all the OptionSets in my dataverse, to detect the "Campaign" dataset, and try to list it's ID's, but I got the following error:

 

alextriggle_1-1668616237970.png

 

Does any one have a solution to get OptionSet IDs on the fly that can then be used to insert a row in dataverse that has an OptionSet field in the record?

 

Thanks and regards

 

Categories:
  • Verified answer
    Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    Hi @alextriggle ,

     

    You can get to the Option or choice from Power Automate by selecting Data>Tables which will take you to Power Apps. Then select Choices:

     

    2022-11-16_23-29-39.gif

    Snag_69c9729.png

    ekarim2020_0-1668641578929.png

    See also: Re: Switch - Power Platform Community (microsoft.com)

    To try and get the option set values on the fly, try the following: 

    Re: Get Dataverse Choices with Label and ID(Value) - Power Platform Community (microsoft.com)

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • alextriggle Profile Picture
    19 on at

    Hi @ekarim2020,

     

    I was looking for a dynamic solution to get the values on the fly, thanks for sharing the link that provided a suitable solution to my need.

  • KRees Profile Picture
    on at

    Hi Ellis

    I wonder if you could help me with something similar.  I am building a flow that requires (choice) response from a CustomVoice Survey to land in a choice field in a dataverse table. In the flow I have created the following 'if' statement 

     

    if(equals(outputs('Get_response_details')?['body/**********'],'A'),1,

    if(equals(outputs('Get_response_details')?['body/**********'],'B'),2,

    if(equals(outputs('Get_response_details')?['body/**********'],'C'),3,'')))

     

    This works really well if the user selects options A, B or C.  The problem is if the user does not select any option and leaves the question blank. Do you have any advice in this instance please?  I have tried '', '0' and 'Null' neither seem to work (it requires an Integer)

    Xch21_0-1669204292827.png

     

    Thanks in advance

  • Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    HI @Xch21 

     

    (1) You could use the empty function 

    if(empty(outputs('Get_response_details')?['body/**********']),'EMPTY','NOT EMPTY' )

     

    (2) Or try the Switch action, using the Default option to handle the Null or empty value:

     

    Snag_1a457420.png

    Snag_1a40a25c.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • KRees Profile Picture
    on at

     The empty function worked, thank you!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard