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

Flow Condition Failing

Hi folks,

 

I'm trying to build a series of flows to follow a process and send emails and update feilds along the way.

 

The problem I have is that the Condition is failing.

The feild is a choice feild of either 0 or 100 ( I need numeric values for later Power BI conditional formatting)

If i set the condition ot 'is equal to' 100 the result comes back as false.

If I add double quotes ("100") it returns as true, but then somehow the quotes are removed from the condition and it returns as false again.

It's doing my head in.

5 REPLIES 5

Hi @NigWatson have you tried using an expression to cast your value as an int?

 

e.g. int(@triggerBody()['myfield'])

Hi Matt,

 

Sorry, you lost me.

Could you explain a little?

 

Thanks

The behaviour you described in your original post suggests to me that your value of "100" is being treated like a string, yet the underlying data type is integeter so Flow is getting itself confused.

 

So rather than it being:

MyField is equal to 100 - where MyField is being treated as a string

 

Try using an expression which will mean that you can tell it explicitly that it's an integer:

int(triggerBody()['MyField']) is equal to 100

 

If you've not played with expressions before let me know and I'll provide a bit more detail about those, but effectively they give you a lot more scope over what you can do with your data.

Hi Matt,

 

I'm having trouble with the expression

 

int(triggerBody()['MyField'])

 

I get the following error:

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2550': 'The template language expression 'int(triggerBody()['RefCheck* Value'])' cannot be evaluated because property 'RefCheck* Value' doesn't exist...

Sorry @NigWatson , I've missed a ? from the expression, need more coffee when trying to answer at night!

 

It should be int(triggerBody()?['MyField']) so for example if I want to explicitly cast the ID field as integer, then it would be: int(triggerBody()?['ID'])

 

So yours would be: int(triggerBody()?['RefCheck'])

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,855)