cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
danh
Level: Powered On

SharePoint list element older than ... days/weeks/months then send email to element creator

We are badly looking for support/help to setup a Flow (template):

1)

If a SharePoint list element is older than a certain period (days, weeks or months) then send an email with hyperlink of the element to the creator of the element, or to the admin or...

2)

same as above but with the trigger "not changed since period (days, weeks or months)"

 

We warmly welcome any support/solution - thx danh

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Hi @danh sorry for not being more clear in my response.

 

Try / Catch

This is a pattern which I've always followed since the introduction of scopes, they allow me to graciously handle any errors which may be thrown when my Flow is running. The Try scope contains all of my logic, and the Catch scope is configured to only run if something in Try fails. My Catch scopes always contain an email to me to tell me that the Flow has failed, a link to the entry in the Flow history, and some basic information from the trigger so that I can track down any problems.

 

Yes, le is less that or equal to, likewise ge is greater than or equal to. You can find more info about the operators in section 4.5 on the following link:

https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

 

The message to me implies one of two things, either the operator hasn't been included i.e. "le" or the datetime you're comparing against hasn't got single quotes around it. ' '

 

So just make sure that your query looks like this:

Modified le '<your expression>'

 

If that still doesn't work, please post a screenshot of your Flow and we'll nail it pretty quickly 🙂





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

danh
Level: Powered On

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Thank you very much 😉 I 'll definitely invest time in learning Flow - thx danh


@MattWeston365 wrote:

 


 

View solution in original post

4 REPLIES 4
Super User
Super User

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Hi danh, you could set something like this up using a Recurrence trigger, if you want to schedule it, or you could run it from a Flow button if it's something you wish to run ad-hoc.

 

My Flow is posted below. It starts off by Getting all of the items from a list (the same logic could apply to a library), and will filter the query based on the modified date being older than 10 days. For that, I have used an expression to subtract 10 days from the current date, using the addDays expression.

 

Alternatively you could use the subtractFromTime expression which would look something like this subtractFromTime(utcNow(),10,'Day')

 

Once I've got my list items returning, I can just send out an email to inform the creator that they need to update their content.

 

ContentOlderThan10Days.PNG





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

danh
Level: Powered On

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Hi - thank you - I did not turn it on yet. It took me quite some time to realize that the Try block  is "Scope", Modified le is "less or equal" 😉 But what is Catch - Scope?

Though I hope you can advice me one more time.

I setup a basic list "test" and instead of period days etc. I use the interval of 10 minutes.

Recurrence trigger is fine.

Filter query: addMinutes(utcNow(),-10)

TEst - all fine, until I click on "See flow run activity", this returns  Status Failed => Scope =>

ActionFailed. An action failed. No dependent actions succeeded.
Get items - BadRequest
Body
  "status": 400,
  "message": "The expression \"Modified 2019-04-10T13:01:02.0480549Z\" is not valid.\r\nclientRequestId: 2a0aecf3-4450-4dce-88b6-e5bd2fab09ce\r\nserviceRequestId: c598d19e-70ed-8000-e280-f02a64dc2a6f"
Can you please help again - thx
Super User
Super User

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Hi @danh sorry for not being more clear in my response.

 

Try / Catch

This is a pattern which I've always followed since the introduction of scopes, they allow me to graciously handle any errors which may be thrown when my Flow is running. The Try scope contains all of my logic, and the Catch scope is configured to only run if something in Try fails. My Catch scopes always contain an email to me to tell me that the Flow has failed, a link to the entry in the Flow history, and some basic information from the trigger so that I can track down any problems.

 

Yes, le is less that or equal to, likewise ge is greater than or equal to. You can find more info about the operators in section 4.5 on the following link:

https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

 

The message to me implies one of two things, either the operator hasn't been included i.e. "le" or the datetime you're comparing against hasn't got single quotes around it. ' '

 

So just make sure that your query looks like this:

Modified le '<your expression>'

 

If that still doesn't work, please post a screenshot of your Flow and we'll nail it pretty quickly 🙂





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

danh
Level: Powered On

Re: SharePoint list element older than ... days/weeks/months then send email to element creator

Thank you very much 😉 I 'll definitely invest time in learning Flow - thx danh


@MattWeston365 wrote:

 


 

View solution in original post

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 (5,360)