cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Flow condition evaluating incorrectly

Hello,

 

I am trying to compare the value of a local optionset with that of the value stored in a record. However for some reason my condition always evaluates to false. 

 

Below is my flow:

 
 

Flow_3.PNG

 

Below is the flow run:

 

Flow_Result_1.PNG

Flow_Result_2.PNG

Flow_Result_3.PNG

 

I am unable to figure out for the life of me as to why the expression result is false? I am essentially trying to compare the optionset value of a record with the value of an optionset that i am looking for. Both of them have a value of 1 when checked individually. However within the expression, it fails. Would be of great help if someone could point out what i could be doing wrong here. Thanks.

 

Regards,

Nithin

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Nithin_Vanam ,

 

Please take a try to add a string expression to the two values in the Condition to see if the issue still exists.

1.png

 

Expression for the First Value in the Condition:

string(outputs('Compose'))

 

Expression for the second value in the condition:

string(outputs('Compose_2'))

 

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Super User III
Super User III

Hi

Not sure if this old post from 2018 is still a valid approach. Please also note it's not specific for CDS but for Dynamics 365

https://benitezhere.blogspot.com/2018/10/referencing-an-option-set-field-in-a-flow-condition-step.ht...

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Community Support
Community Support

Hi @Nithin_Vanam ,

 

Please take a try to add a string expression to the two values in the Condition to see if the issue still exists.

1.png

 

Expression for the First Value in the Condition:

string(outputs('Compose'))

 

Expression for the second value in the condition:

string(outputs('Compose_2'))

 

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Super User III
Super User III

Hello,

Two things:
1) Set variables should not be used inside a Apply to each loop unless concurrency is set to 1, this can be done by clicking on the Apply to each loops > 3 dots and select settings > turn on concurrency and set to 1.

You can get around this by using a Data Compose shape instead of a Set variable inside loop — this may not cause you problems now. But it’s very plausible it will in the future.

2) Depending on if the entity you are searching on is a lookup or not. I always use a List records and see the exact value that gets pulled. Sometimes Option sets look like 100001, 100002, etc.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




@efialttes : I am using the CDS trigger and CDS actions in my flow and so i am restricted to using the Option Set values for my condition.

 

@v-alzhan-msft : Your suggestion did the job when i used the compose actions and passed the option set values as inputs. Post that i used the output from the compose actions and set them as strings through the string() expression you suggested. However i am still intrigued as to why trying to compare the values directly is not resulting in a valid evaluation of the condition. I used the string expression and passed the values directly like this:

string(outputs('Get_Web_Source')?['body/esavvy_location'])

within the condition without having to use the compose and that worked too.

Flow_4.PNG

 

@Jcook : Could you please expand a little bit more on not using set variables inside a loop and about the impact of setting concurrency?

 

Thank you all for your inputs 😁

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (60,180)