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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Initialize Variable for Choice Field Not Working in Power Automate

(0) ShareShare
ReportReport
Posted on by 70

Hi,

I have a Choice field named 'Application Type', and when that field is modified, I want to trigger an action. So for that I used the trigger 'When a row is modified', and then I Initialized Variable for that choice field as follows (please refer screenshots)...

PowerUser06_5F00_1_2D00_1663627668186.png

Then I applied a condition on that Initialized Variable...

 PowerUser06_5F00_2_2D00_1663627765125.png

So if the value of the Choice field is a particular value, I want to trigger an action, but whether the value is equal to my chosen value or not, the result of the condition is always returning 'false', and the 'If no' action is the one that is always being triggered. 

Can someone please tell me what is wrong with my condition?

Thanks!

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Partner,

    In your example, Application Type is number but AppType is string. If you are trying to compare number type to string than the condition will never satisfied.

    Now, you can choose to modify the type of either of them to match:

    (1)Change Application Type value to string:

    --a. Using expression: string(24887003)

    pastedimage1663641719066v2.png

    --b. Adding double quotes to static value(24887003) directly

    pastedimage1663641474808v1.png

    (2)Change AppType variable:

    pastedimage1663642084781v3.png

  • D365 User 06 Profile Picture
    70 on at

    @ Leah Ju

    Thank you for your response. The actual options in the 'Application Type' field are strings, i.e., 'New', 'Renewal', 'Resubmission', 'Extension', etc. So the actual options are strings, but the number I have used is the number value of these choice labels. This number represents the option 'Extension'. The flow run shows that the Trigger of my flow has captured both the values correctly. This is what is shown in the output...

    {

     "new_applicationtype": 248870003,

     "_new_applicationtype_label": "Extension"

    }

    Even the output of my action branch that ran after the condition returned false has captured the value and label correctly..

    {

    "aparnasw_applicationtype@OData.Community.Display.V1.FormattedValue": "Extension",

     "aparnasw_applicationtype": 248870003

    }

    So I am not able to figure out where the problem lies. Thank you for your help.

  • Community Member Profile Picture
    on at

    Hi Partner,

    Yes, the values are all correct, it is only the type inconsistency that causes this.

  • Suggested answer
    D365 User 06 Profile Picture
    70 on at

       

    You are right, I put quotes around the number value in the Condition and now my flow is working!

    pastedimage1663733872346v1.png

    Thanks a lot, Leah!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans