Oct 05 2021 12:15 AM
Hello all,
I would like to introduce some kind of approval procedure in sharepint. I would like that when an object is edited, it is sent to an approver beforehand who then approves it. The requestor and approver should be entered in an excel list with date and time. do you know a simple solution? thank you very much.
Oct 05 2021 01:15 AM - edited Oct 05 2021 01:17 AM
Solution@Tison5 Power Automate is the app to do this. In your main SharePoint list you will need single line of text columns for the approver name, approval date and the outcome (which will either be approve or reject). You will also need a multiple lines of text column for any comments made by the approver.
In the example below there is a second list in SharePoint with the approver's email for each department and it sends it to the approver for the department the user selected.
The user adds a new item to the main list:
In the flow the trigger is the SharePoint "when an item is created". Next we add an "initialize a string variable" action and set it to the department selected by the user.
Next, add a SharePoint "get items" action and add a filter query so that it will only bring back the item in the approvers list with the seleted department. For this you need to add an expression from the dynamic content box of Title eq '{varDepartment}'
Next, add an "apply to each" action and select value from the get items section of the dynamic content box. Next add a "start and wait for an approval action". Enter the information requested and for the assigned to select Approver from the gert items section of the dynamic content:
Once the approval has been done we want the item in the list updated with the details of the approver and any comments they made. So still inside the apply to each add an "update item" action and for the columns that hold the approval details you select these from the start and wait for an approval section of the dynamic content box. When you select responses comments you'll see that the actio wraps itself in another apply to each. This is expected.
So when the user adds an item to the list the flow will trigger and an email will be sent to the approver. This is in the form of an adaptive card which means the approver can select their decision and add any comments right within the email. tghey need to do this within 30 days or the approval times out and fails.
And when the approvers clicks the submit button the adaptive card closes:
The flow carries on running and updates the list item with the approval details:
Instead of the update item action you could get the approval details added to a table in Excel.
Come back with any questions about this.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Jan 18 2022 04:38 AM
@RobElliott How can we get this to work to send multiple slected list items to a single approver?
As soon as multiple list items are selected the power automate options disappear!
Jan 18 2022 04:59 AM
@john_pearson1 this isn't possible because how would the flow deal with an item that was NOT approved amongst several items that were? The approval action is linked to just 1 item and can't handle multiple items.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Jan 18 2022 07:07 AM
@RobElliott the simple answer; all or nothing approvals which would suit plenty of cases. If a single item needs some remediation you note that, make the change and resend the approval. This would be far more efficient than sending 3 or more approvals for separate items.
I'll see if I can redesign the list in the meantime, maybe that's another way to solve it.
Jan 18 2022 08:16 AM
@john_pearson1 I think you misunderstood me; you will need 1 approval email for each item. You cannot combine them into a single approval.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Jan 18 2022 09:25 AM
Jan 18 2022 09:28 AM
Jan 18 2022 09:29 AM - edited Jan 18 2022 09:44 AM
Apologies, I thought my earlier posts had made it clear that it is one approval email for one item.