During the Covid-19 crisis, many companies were forced to send their employees’ workplaces to the home office overnight.
Unfortunately, some business processes fail by the wayside, especially where the approval of documents such as incoming invoices or delivery bills was concerned.
A possible solution is to create a corresponding list in SharePoint, in which information about the requestor and the approving person or group of persons is stored and the document is attached.
The information about the approving person or person group can be mapped with the field type “Person or Group” with activated “Allow multiple Selection” option.
Here in my example I react on a newly created entry in a corresponding SharePoint list. For this I use the standard SharePoint Connector and the trigger When an item is created.
In order to use the action Start and wait for an approval correctly, a few steps have to be done before, because otherwise the Start and wait for an approval would be included in an Apply to Each function, because the SharePoint list would return more than one entry in the corresponding column of the type Person.
To do this, I first initialize a variable using the action “Initialize a variable”. For this variable I use the type String.
In order to get to the mail addresses to which the approval workflow should be sent, the first thing I need to do is include a Parse JSON action, which is performed in an Apply to each context on the Approver column.
In the Parse JSON action I have to integrate the information from the When an item is created trigger. For this I use the function Generate from Example where I fill in the output of the When an item is created trigger.
Here is the required JSON schema from my example.
With this schema, I can then next use the Append to string variable action to populate the variable with the required mail addresses. To do this, I use the value for Email from the Parse Json step.
It is important to add a semicolon after variable in the value field, otherwise there will be an error in the next step, because there is no listing of the mail addresses if there are more than one approvers.
Now the preparations are done so that the approval workflow can run correctly.
In my example I use the Approve type Approve/Reject – First to respond to make sure that only one person has to approve.
Next are a few screenshots from the example process I used. Here, 2 people were stored as possible approvers.
First releasing person:
Second releasing person:
After the second person has approved, the approval request updates with the first person, indicating that the approval has already been done by someone else.
In my workflow, I have then updated the corresponding SharePoint list entry via the action “Update Item”, in order to be able to recognize by whom the release has been made.
Here is an overview of the update process.
Finally I want to visualize the complete process:
How cool is that 😉