cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rinu007
Helper II
Helper II

Loop through and find expiry date of documents

Hi

 

I am trying to create a flow so that I can sent a reminder to certain users about the expiry date of documents in the document library, based on a column ExpiryDate.

 

I am pretty new to this so any help will be greatly appreciated.

 

I am getting an error of fiter quries expression 

Capture.JPG

 
2 ACCEPTED SOLUTIONS

Accepted Solutions
CollabTechie
Responsive Resident
Responsive Resident

Hi @rinu007 , the below Flow will enable you to achieve this

Here is the expression that goes into the 90 day variable and as you can see, this can be changed to how many days you would like.

 

formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd')

 


app1.PNG



----------------------------------------------------------------------------------------------------------------------------------------
If my reply was helpful consider giving a THUMBS UP or if my reply solved your issue, please ACCEPT SOLUTION as this will help other members find the solution.

View solution in original post

@rinu007 I do it like this. The filter query in this example is NextReview ge '{utcNow()}' and NextReview le '{addDays(utcNow(),30)}'
0-Trigger-Get-Select.png

 

1-Create-html-Replace-Email.png

 

2-Email-Result.png

This email was just going to me, but on some of our sites we have the document owner in a column in the document library and the email can go to whoever the document owner is. But that makes the flow a bit more complex so I haven't shown it here.

Whenever you use a months in your expressions make sure you use MM, not mm.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

View solution in original post

7 REPLIES 7
CollabTechie
Responsive Resident
Responsive Resident

Hi @rinu007 , the below Flow will enable you to achieve this

Here is the expression that goes into the 90 day variable and as you can see, this can be changed to how many days you would like.

 

formatDateTime(addDays(utcNow(),90),'yyyy-MM-dd')

 


app1.PNG



----------------------------------------------------------------------------------------------------------------------------------------
If my reply was helpful consider giving a THUMBS UP or if my reply solved your issue, please ACCEPT SOLUTION as this will help other members find the solution.

View solution in original post

RobElliott
Super User
Super User

Hi @rinu007, are you sure you want to be looking at an expiry date that is more than 90 days ahead? I would have thought you would want any documents expiring within the next 90 days so the expression would be le

Secondly put the expression inside apostrophes.

filter-query-apostrophes.png

 Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Thanks Rob,

 

May i ask one more, how will you loop through the items and sent email for all the items which is less than 30 days.

 

 

Capture.JPG

Thanks for that collab,

 

I would like to save the items in a string and send it as a consolidated list in an emails. I was attempting the below.

 

Capture.JPG

Hi collab,

 

I was trying to make changes to the flow with your post,

 

our date format is  'mm-dd-yyyy'

formatDateTime(addDays(utcNow(),90),'mm-dd-yyyy')
 
the value in v90DayReminder is 48-22-2020

 

and got the below error 

{
"status": 400,
"message": "String was not recognized as a valid DateTime.
 
May be there needs to be some change to dataTime in format?
to accommodate 'mm-dd-yyyy' 

@rinu007 I do it like this. The filter query in this example is NextReview ge '{utcNow()}' and NextReview le '{addDays(utcNow(),30)}'
0-Trigger-Get-Select.png

 

1-Create-html-Replace-Email.png

 

2-Email-Result.png

This email was just going to me, but on some of our sites we have the document owner in a column in the document library and the email can go to whoever the document owner is. But that makes the flow a bit more complex so I haven't shown it here.

Whenever you use a months in your expressions make sure you use MM, not mm.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

View solution in original post

Thank you Rob, 

 

I would appreciate if you can show me the sample that sent to the document owner, as this has became a new requirement.

 

 

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!

Top Solution Authors
Top Kudoed Authors
Users online (1,807)