cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Flow condition evaluating incorrectly

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
Highlighted
Dual Super User
Dual Super User

Re: Flow condition evaluating incorrectly

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!



Highlighted
Community Support
Community Support

Re: Flow condition evaluating incorrectly

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

Highlighted
Super User
Super User

Re: Flow condition evaluating incorrectly

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!





Highlighted
Helper II
Helper II

Re: Flow condition evaluating incorrectly

@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
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,310)