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 / Condition to update Da...
Power Automate
Suggested Answer

Condition to update Dataverse choice column where variable equals a certain integer value

(1) ShareShare
ReportReport
Posted on by 49 Season of Giving Solutions 2025
Hello,
 
I'm working on a power automate to trigger when a microsoft form is submitted. This is then retrieves the response details, sets a bunch of variables and inserts a row into a dataverse table 'applications'.
 
One of the questions in the forms asks the person to insert a value between 1 and 5. 
 
Within the dataverse table I have a choice column called 'no of days' - labels and value below.
 
 
When I'm adding a row I need to insert the relevant value to the choice column. So, if in the form they insert '2' I need to write a condition to check the value of my variable and insert the value 508690001. I also need to account for all values between 1 and 5.
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,001 Super User 2026 Season 1 on at
    Hello @hpayne1993
     
    Yes, Dataverse Choice columns don’t accept the label name. They only accept the choice value. 
     
    Since your Form returns 1–5 and your choice values are 508690000, 508690001, etc., you need to map them.
     
    Add a Switch action on the Forms response (1–5)
    For each case, set a variable to the correct choice value
    Use that variable in No of days (Value) when inserting the Dataverse row.
     
     
    You need to add a condition for each day, store the value, and then use that variable in the Dataverse action.
     
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
     
  • Chriddle Profile Picture
    8,691 Super User 2026 Season 1 on at
    You could change the choice values to match the labels.
  • Chriddle Profile Picture
    8,691 Super User 2026 Season 1 on at
    If you can't change the choice values, you can also calculate the value from the label (just add 508689999)
     
    or create a dictionary:
     
    and access it like this: @{outputs('Compose-Dict')['2']}
  • hpayne1993 Profile Picture
    49 Season of Giving Solutions 2025 on at
    Thanks @Kalathiya
     
    My next issue is when I'm running the flow this error occurs at the point of setting the variable:
     
    The execution of template action 'Set_variable_4' failed: an unexpected exception encountered when evaluating branching condition.
     
    Could this be because the item from the MS form in switch is string format? How do I convert that to an integer?
     
  • Kalathiya Profile Picture
    2,001 Super User 2026 Season 1 on at
    Hello @hpayne1993
     
    Please check that the variable type is set to Integer.
     
     
    if it's not resolved, could you please share the error details?
     
  • Suggested answer
    S-Venkadesh Profile Picture
    1,214 Super User 2026 Season 1 on at
     
    You can retrieve the values dynamically from the labels received from Microsoft Forms.

    For more details, please refer to this article: https://hellom365.in/power-automate-dataverse-how-to-get-choice-field-values-from-labels-51adddbc330f
     
    ✔️ If this answered your question, please click “Does this answer your question?” so it can help others in the community too.
    🩵 If it helped, please give it a Like!
    Best regards, 
    S. Venkadesh

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard