cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Simple flow help - Review flow

Hi - I am new to all of this and have a very simple question

 

I would like to create an auto generated email to a document owner 30 days before expiry of a document to inform them to review content.  Is there a template that can achieve this?  

 

Any help appreciated.

Gareth

15 REPLIES 15
Highlighted
Super User II
Super User II

Hi @gforber 

 

Can you define how you define the expiration date of the document? Stored somewhere? A rule in SharePoint?

 

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

Cheers
Manuel

Highlighted

Hi manuel,

 

This expiration date will be held as a data field in the SharePoint library that will be manually updated

 

Regards,

Gareth

Highlighted

HI @gforber 

 

I would do the following:

  1. Trigger - select the scheduled option and run it in the frequency you want.
  2. Get all the values that you didn't send an email. You can use an OData query to achieve by doing a query like <Date's Field> lt addDays(utcnow(),-30) AND <EmailSent> nq 'Yes'.
  3. For each value, send an email and update it with the flag "Email Sent."

 

That's it :).

 

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

Cheers
Manuel

 

Highlighted

@manuelstgomes  Sorry for the stupid question, this is the first time I've used flow.  is an OData query the same as an SQL query?  We don't have that enabled on our flow service.

 

Highlighted

Hi @gforber 

 

It's not a stupid question at all. It's my fault I didn't explain it properly.

 

Please check if this example helps you.

2020-02-05 15_10_57-Create your flow _ Power Automate.png

 

I used the "Created" field to test but you can replace it with the name of the SharePoint column that stores the expiration date.

 

The OData is inserted when we do a "Get Items" so that we query the database and only retrieve the information that we want. This way we don't need to pull all information from the database. 

 

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

Cheers
Manuel

Highlighted

@manuelstgomes  Thank you - I think I am almost there so thank you so much for your help.  One question though - my documents sit in a Sharepoint library and GetItem - how do I reference a library ?  I can see GetFile(Properties Only) but that doesn't seem to work.

 

thanks again

Highlighted

Hi @gforber 

 

Try the "List Folder". You should be able to see the files in that Library..

 

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

Cheers
Manuel

Highlighted
Frequent Visitor

Hi Manuel

 

Thanks for your help

 

When I use "List Folder", I can't see how I can then add in the query?  Am  I missing something ?

Highlighted
Frequent Visitor

Hi @manuelstgomes 

 

Thanks for your help

 

When I use "List Folder", I can't see how I can then add in the query?  Am  I missing something ?

Highlighted

@manuelstgomes 

 

I managed to setup the query using  Get Files (Properties only) but I am seeing the following error

 

Capture.JPG

Any ideas ? 🙂

Highlighted

@gforber  Your filter query isn't quite right, it should be ne (which stands for not equal to), not nq.

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.

Highlighted

@RobElliott   many thanks for your help, much appreciated.  I am still getting the same error though 😞

 

Capture.JPGUntitled.png

 

Highlighted

@gforber you need to surround the pink expression with single quotes ' '
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.

Highlighted

@RobElliott  Thank you - the flow now validates  but I don't get an email.

 

My original intention  was 30 days before a date set in the Review column, an email is generated as a reminder.   If I set the review date to 11/02/20, it should run and I get an email based on the query below ?

 

latest.jpg

 

Highlighted

@RobElliott does the datetime format on SharePoint library have any impact?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Kudoed Authors
Users online (9,960)