cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
abwaters
Level: Power Up

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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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

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!
abwaters
Level: Power Up

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (7,470)