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

add days for each row

Hello,

 

i am trying to create a flow for expiration contracts reminders. I have a column with expiration date and a column with number of days which i want to be notified.

for each items i check if "expiration date" is less than today plus expiration days set in each row

lunico88_0-1631566934975.png

my expression is: addDays(utcNow(), item('expdays'), 'yyyy-MM-dd')

but when i test the flow i receive the error: " 'item' function must not have no parameters.

do you know the correct syntax to achive my goal ?

1 ACCEPTED SOLUTION

Accepted Solutions

i found out that the correct formula is: adddays(utcNow(), int(item().expdays), 'yyyy-MM-dd')

 

it is important to set as int because number in column "expdays" are seen as float even if wrote as integer, so you need to convert them.

my problem is solved with new formula anyway. Thnak you 

View solution in original post

4 REPLIES 4
abm
Super User
Super User

Try

 

Days(utcNow(), item()?['expdays'], 'yyyy-MM-dd')

 

Also format the left side SharePoint date to

 

formatDateTime('yoursharepointdatecoulumn', 'yyyy-MM-dd')

 

Replace the 'yoursharepointdatecoulumn' to Scadenza (Believe thats the SharePoint column name').

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

i adjusted the formula as you told me, but i receive this error:

 The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@less(item()?['Scadenza'], addDays(utcNow(), item()?['expdays'], 'yyyy-MM-dd'))' failed: 'The template language function 'addDays' expects its second parameter to be an integer. The provided value is of type 'Null'. 

expdays is a column which accept only integer value (30, 60 ecc..)

Hi @lunico88 

 

This error means in your expression item()?['expdays'], 'yyyy-MM-dd') item()?['expdays'] is null. There are no values being passed. Check the run history of the flow and see what values are retrieving. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

i found out that the correct formula is: adddays(utcNow(), int(item().expdays), 'yyyy-MM-dd')

 

it is important to set as int because number in column "expdays" are seen as float even if wrote as integer, so you need to convert them.

my problem is solved with new formula anyway. Thnak you 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,895)