cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Error with expression in condition

I am trying to use the addDays expression to check if the current date plus a number of days saved in a SPO list item equals the Due Date saved in the same list. I do a Get Items > Current Time (for today's date) > Filter Array to only use items with a status of "In Process" > then an Apply to Each containing a condition with the following:

@equals(addDays(body('Current_time'), int(body('Get items')?['First warning'])), items('Apply_to_each')?['Due_x0020_date'])

My second parameter always returns null. I have tried changing "body('Get items')?['First warning'])" to "items('Apply_to_each')?['First warning']" but still get an error. 

 

Please help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Error with expression in condition

Hi @abwaters,

 

What is the type of the "First warning" column in your sharepoint list?Is it s Number type?

 

I have made a test on my side to create the "First warning" column in sharepoint list with a Number type, and I have create the flow as below:

Capture.PNG

 

The expression in the Filter array as below:

@equals(item()?['status']?['Value'], 'In Process')

The expression in the Condition as below:

@equals(formatDateTime(addDays(utcNow(), int(item()?['First_x0020_warning'])), 'yyyy-MM-dd'), formatDateTime(item()?['Due_x0020_Date'], 'yyyy-MM-dd'))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Error with expression in condition

Hi @abwaters,

 

What is the type of the "First warning" column in your sharepoint list?Is it s Number type?

 

I have made a test on my side to create the "First warning" column in sharepoint list with a Number type, and I have create the flow as below:

Capture.PNG

 

The expression in the Filter array as below:

@equals(item()?['status']?['Value'], 'In Process')

The expression in the Condition as below:

@equals(formatDateTime(addDays(utcNow(), int(item()?['First_x0020_warning'])), 'yyyy-MM-dd'), formatDateTime(item()?['Due_x0020_Date'], 'yyyy-MM-dd'))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

View solution in original post

Highlighted
Administrator
Administrator

Re: Error with expression in condition

Hey, @abwaters!

Thank you for posting on the Flow Community Forum! It appears as though @v-yuazh-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
Highlighted
New Member

Re: Error with expression in condition

Yes the First Warning field is a number type - number of days before the Due Date. What you put up is very helpful. I really appreciate it. I think the expressions are pretty powerful if you understand the syntax. I actually have my flow working great. Just have to get the data in my SPO list. 

 

Thanks again!

 

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

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 (7,468)