cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KarenLeite
Regular Visitor

Submitting Multiple Items from Sharepoint for Approval

I have a list of overtime requests, where each person must register when they request it. These data are stored in Sharepoint which triggers a Power Automate flow sending an approval request to the supervisor, but this happens for each item created.
In other words, if there are 20 people requesting overtime, it will be 20 emails to the supervisor of that team! 😕
I need to create a flow in Power Automate, where Sharepoint items will be filtered by "supervisor name" and "current day".
Then I need Power Automate to send the filtered people's name in an email to the supervisor responsible for them. 

It is possible?

1 ACCEPTED SOLUTION

Accepted Solutions

@KarenLeite 

 

This should be possible. First, rather than an approval request, perhaps instead it should just place it in as SharePoint List Items and a Office 365 Outlook Send an Email action. 

 

It is possible to filter by items - possibly even with the out of the box field for when the item was created. For example, it might be possible to use an OData Filter Query in the Get Items Action. 

 

From Power Automate, you could have a recurring Flow that runs at a specific time every day such as towards the end of the work day, e.g. 4:30 PM EST, etc. This Flow could use a Get Items action with an OData Filter Query to get the items only from the past 24 hours for example or any other range you want. Then these items can be iterated over using an Apply to Each, and the Name column can be concatenated into a String variable initialized at the top of the Flow.  This string variable can then be placed in an Office 365 Outlook Send an Email Flow Action to send one email instead of many.

 

In order to send to specific supervisor, there can be, say, a place where the Flow gets a list of supervisors (or it is hard coded as an Array even). Then an outer Apply to Each can be placed where the current supervisor is there for each item - the aforementioned Apply to Each (and ultimately the Send an Email action that should come after the Apply to Each) can all be then be inside that "outer" Apply To Each. Ultimately when it gets to Send an Email one each iteration, the outer Apply to Each's current Email Address of the Supervisor can be placed in there. The inner Apply to Each can take the Supervisor into account during the filtering as well in addition to the current day. If a variable was used to concatenate the names of people requesting, remember to set the variable to an empty string after each iteration of the outer loop, so that each supervisor only gets the names of the people form their department - otherwise, the 2nd supervisor might get their own plus the 1st supervisor's, the 3rd supervisor might get the list from their own, the 2nd' team, and the 1st's team, and so forth, so watch out for that if doing it that way.

 

Alternatively to making an outer an inner apply to each, the "inner apply to each" can be self contained a "child flow" whereas the "outer apply to each" can be in its own Flow that calls the child Flow from inside it and passes the Supervisor's Name in there. If you're not sure what this means with 'child Flow' and wish to just keep it all in one Flow, you can disregard this part as it is optional and just use nested loop in the same Flow as described above.

 

See if the above helps you as starting point. In case it does not, I might see if I have some time to provide full, working example, but I think it would be better if you tried first to do it based on the above summary explanation and see if you could figure it out first.

View solution in original post

1 REPLY 1

@KarenLeite 

 

This should be possible. First, rather than an approval request, perhaps instead it should just place it in as SharePoint List Items and a Office 365 Outlook Send an Email action. 

 

It is possible to filter by items - possibly even with the out of the box field for when the item was created. For example, it might be possible to use an OData Filter Query in the Get Items Action. 

 

From Power Automate, you could have a recurring Flow that runs at a specific time every day such as towards the end of the work day, e.g. 4:30 PM EST, etc. This Flow could use a Get Items action with an OData Filter Query to get the items only from the past 24 hours for example or any other range you want. Then these items can be iterated over using an Apply to Each, and the Name column can be concatenated into a String variable initialized at the top of the Flow.  This string variable can then be placed in an Office 365 Outlook Send an Email Flow Action to send one email instead of many.

 

In order to send to specific supervisor, there can be, say, a place where the Flow gets a list of supervisors (or it is hard coded as an Array even). Then an outer Apply to Each can be placed where the current supervisor is there for each item - the aforementioned Apply to Each (and ultimately the Send an Email action that should come after the Apply to Each) can all be then be inside that "outer" Apply To Each. Ultimately when it gets to Send an Email one each iteration, the outer Apply to Each's current Email Address of the Supervisor can be placed in there. The inner Apply to Each can take the Supervisor into account during the filtering as well in addition to the current day. If a variable was used to concatenate the names of people requesting, remember to set the variable to an empty string after each iteration of the outer loop, so that each supervisor only gets the names of the people form their department - otherwise, the 2nd supervisor might get their own plus the 1st supervisor's, the 3rd supervisor might get the list from their own, the 2nd' team, and the 1st's team, and so forth, so watch out for that if doing it that way.

 

Alternatively to making an outer an inner apply to each, the "inner apply to each" can be self contained a "child flow" whereas the "outer apply to each" can be in its own Flow that calls the child Flow from inside it and passes the Supervisor's Name in there. If you're not sure what this means with 'child Flow' and wish to just keep it all in one Flow, you can disregard this part as it is optional and just use nested loop in the same Flow as described above.

 

See if the above helps you as starting point. In case it does not, I might see if I have some time to provide full, working example, but I think it would be better if you tried first to do it based on the above summary explanation and see if you could figure it out first.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (1,913)