cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pandra801
Regular Visitor

Using the AND expression - Syntax question

Hello,

 

Trying to get past something that I expected to be easy:

 

If Y/N field 1-HR Complete is set to true AND the value of text field Progress is set to Step 1, my condition should return as TRUE

 

It does not, and have verified that the data actually meets the condition. This is the code in advanced mode:

 

@and(equals(items()?['1-HR Complete']?['Value], True), equals(item()?['Progress']?['Value'], 'Step 1'))

 

Can someone point me in the right direction? 

 

AND expression.PNG

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

The following formula worked for me:

and(equals(triggerBody()?['OData__x0031__x002d_HR_x0020_Complete'], true), equals(triggerBody()?['Progress'], 'Step 1'))

 

The field names were entered in the formula by selecting the via Dynamic data.

 

I successfully tested the following Flow:

 

And1.pngAnd2.pngAnd3.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
ScottShearer
Super User
Super User

The following formula worked for me:

and(equals(triggerBody()?['OData__x0031__x002d_HR_x0020_Complete'], true), equals(triggerBody()?['Progress'], 'Step 1'))

 

The field names were entered in the formula by selecting the via Dynamic data.

 

I successfully tested the following Flow:

 

And1.pngAnd2.pngAnd3.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
v-xida-msft
Community Support
Community Support

Hi @Pandra801,

 

Could you please show more details about your SharePoint list?

 

I think there is something wrong with the formula that you specified within the Condition box of your flow. I have created a SharePoint list on my side and the data structure of it as below:22.JPG

Note: The 1-HR Complete column is a Yes/No type column in my SharePoint list and the Progress column and the TaskName column are both Single line of text type column.

 

Please take a try with the following workaround:

  • Add a "When an item is created" trigger, specify Site Address and List Name.
  • Add a Condition, click "Edit in advanced mode", type the following formula:

 

@and(equals(triggerBody()?['OData__x0031__x002d_HR_x0020_Complete'], true),equals(triggerBody()?['Progress'], 'Step 1'))

 

  • Within "If/yes" branch of Condition, add a "Send an email" action.

Note: Within Condition box, you could select 1-HR Complete dynamic content of the trigger within left input box and type true within right input box as below:25.JPG

Then when you click "Edit in advanced mode", the formula would be changed as below:26.JPG

 

Image reference:24.JPG

The flow works successfully as below:23.JPG

 

More details about using expression in flow actions, please check the following article:

Using expression in flow actions

 

Best regards,

Kris

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

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,999)