cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gforber
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
manuelstgomes
Community Champion
Community Champion

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

Hi manuel,

 

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

 

Regards,

Gareth

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

 

@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.

 

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

@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

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

gforber
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 ?

gforber
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 ?

gforber
Frequent Visitor

@manuelstgomes 

 

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

 

Capture.JPG

Any ideas ? 🙂

@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.

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

 

Capture.JPGUntitled.png

 

@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.

@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

 

gforber
Frequent Visitor

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

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,466)