cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Flow to send a email every friday , based on item added properties in Sharepoint Document Library.

Dear Members,

 

I have an SP document library and whenever a new item, is added or modified an email should be triggered (i.e Friday 4:30 every Week).

 

These are the steps, I am following but I am unable to receive any mail.

 

error1.PNG

 

error2.PNG

 

error4.PNGerror5.PNG

 

 

Condition checking :

 

Recurrence: Every Friday at 4:30 pm

 

For test purposes, I have given it to 5 mins.

 

Can you please help me with this error.

 

Regards,

Eswar

 

 

 

 

  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

One additional thing to note: if you save and close the flow it  runs with no problem. But if you edit the flow again the syntax in the Select will have been changed and you need to add back in the starting and ending " and the 2 \ and save it again. It's just one of Power Automate's little irritations.

Rob
Los Gallardos

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

@Eswar1  why are you using a 5 minute recurrence? It's not doing anything and it means you have 2 triggers in your flow which is incorrect. Are you wanting an email to be sent each time a file is created or modified, or do you want an email to be sent with a list of all files created or modified in the last week? Let us know which it is and one of us here will provide the steps.

Rob
Los Gallardos

Highlighted

Dear RobElliott

 

 

 

 

 

Please provide me the steps to achieve this.

 

Thanks,

Eswar Teki

 

 

 

Highlighted

@Eswar1 sorry for the delay in replying, work got in the way.  OK so you can have the flow run at 4.30 every Friday and get a result like this:
00-Email-Result.png

 Our SharePoint documents library has just the 2 items that have been created in the last week:
0-SP-List.png

The trigger is a Recurrence schedule to run at 16:30 every Friday.

Next, add a SharePoint Get items action. As you're using a documents library you'll need to enter its name as a custom value. We don't want it to loop through the whole list as that's not very efficient, we only want the Get items action to bring back the documents modified less than 7 days ago. So add a filter query of

Modified gt {expression: addDays(utcNow(),-7)}

where gt means greater than. Make sure you put the expression inside ' ' apostrophes:

1-recurrence-getItems.png

Getting the link to items to be actual links in the email is a bit difficult and there are a few steps we need to take. Add a Select data operations control. To get the Link to item and Title fields from the dynamic content you need to start adding them in the Map fields:
2a-selectFields.png

 Then click the T icon to the right of the Map fields. That will put the mapping into JSON format:

2b-select-JSON.png

 Delete the { and } and the "Link": and "Title": and make sure you end up with the following syntax.

2-select-result.png

Next add a Join data operations control and select the output of the Select. In the Join with field add <br/>. That will put each item on a separate line in the email:

3-join.png

 Finally, send the email and into the body add the Output from the Join:

4-email.png

The items in the email link to the documents in the library which can be difficult if you use a Create HTML Table action. This method works well.
00-Email-Result.png

You can test this whenever you like, not by adding a 5 minute recurrence but by going to Test in the top right of the flow and clicking "I'll perform the trigger action".

Do come back if you have any questions or problems with this.

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

One additional thing to note: if you save and close the flow it  runs with no problem. But if you edit the flow again the syntax in the Select will have been changed and you need to add back in the starting and ending " and the 2 \ and save it again. It's just one of Power Automate's little irritations.

Rob
Los Gallardos

View solution in original post

Highlighted

Thank you bob, it what i wanted.

 

Just wanted to check, if we can restrict the number of items.

 

Regards,

Eswar

Highlighted

You are already restricting the list by only bringing back those modified in the last week. What other restriction are you wanting to apply?

Rob
Los Gallardos

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.

Users online (11,691)