{"id":431,"date":"2020-12-18T10:19:16","date_gmt":"2020-12-18T09:19:16","guid":{"rendered":"https:\/\/dynamiacs.com\/?p=431"},"modified":"2021-02-20T19:57:14","modified_gmt":"2021-02-20T18:57:14","slug":"multiple-approver-from-sharepoint","status":"publish","type":"post","link":"https:\/\/dynamiacs.com\/?p=431","title":{"rendered":"Multiple Approver from SharePoint"},"content":{"rendered":"\n<p>During the Covid-19 crisis, many companies were forced to send their employees&#8217; workplaces to the home office overnight.&nbsp;<\/p>\n\n\n\n<p>Unfortunately, some business processes fail by the wayside, especially where the approval of documents such as incoming invoices or delivery bills was concerned.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>The information about the approving person or person group can be mapped with the field type &#8220;Person or Group&#8221; with activated &#8220;Allow multiple Selection&#8221; option.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-11.png\" alt=\"\" class=\"wp-image-432\" width=\"238\" height=\"483\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-11.png 388w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-11-148x300.png 148w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/figure>\n\n\n\n<p>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&nbsp;<strong>When an item is created<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-12.png\" alt=\"\" class=\"wp-image-433\" width=\"457\" height=\"177\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-12.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-12-300x116.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-12-768x298.png 768w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\n\n\n\n<p>In order to use the action&nbsp;<strong>Start and wait for an approval<\/strong>&nbsp;correctly, a few steps have to be done before, because otherwise the&nbsp;<strong>Start and wait for an approval<\/strong>&nbsp;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.<\/p>\n\n\n\n<p>To do this, I first initialize a variable using the action &#8220;Initialize a variable&#8221;. For this variable I use the type String.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-13.png\" alt=\"\" class=\"wp-image-434\" width=\"453\" height=\"194\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-13.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-13-300x128.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-13-768x329.png 768w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/figure>\n\n\n\n<p>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&nbsp;<strong>Parse JSON<\/strong>&nbsp;action, which is performed in an&nbsp;<strong>Apply to each<\/strong>&nbsp;context on the Approver column.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-14.png\" alt=\"\" class=\"wp-image-435\" width=\"447\" height=\"380\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-14.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-14-300x255.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-14-768x653.png 768w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/figure>\n\n\n\n<p>In the&nbsp;<strong>Parse JSON<\/strong>&nbsp;action I have to integrate the information from the&nbsp;<strong>When an item is created<\/strong>&nbsp;trigger. For this I use the function&nbsp;<strong>Generate from Example<\/strong>&nbsp;where I fill in the output of the&nbsp;<strong>When an item is created<\/strong>&nbsp;trigger.&nbsp;<\/p>\n\n\n\n<p>Here is the required JSON schema from my example.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-25.png\" alt=\"\" class=\"wp-image-446\" width=\"446\" height=\"308\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-25.png 570w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-25-300x207.png 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/figure>\n\n\n\n<p>With this schema, I can then next use the&nbsp;<strong>Append to string variable<\/strong>&nbsp;action to populate the variable with the required mail addresses. To do this, I use the value for Email from the&nbsp;<strong>Parse Json<\/strong>&nbsp;step.&nbsp;<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-15.png\" alt=\"\" class=\"wp-image-436\" width=\"446\" height=\"130\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-15.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-15-300x88.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-15-768x225.png 768w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/figure>\n\n\n\n<p>Now the preparations are done so that the approval workflow can run correctly.<\/p>\n\n\n\n<p>In my example I use the Approve type&nbsp;<strong>Approve\/Reject &#8211; First to respond<\/strong>&nbsp;to make sure that only one person has to approve.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-16.png\" alt=\"\" class=\"wp-image-437\" width=\"444\" height=\"341\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-16.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-16-300x230.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-16-768x590.png 768w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/figure>\n\n\n\n<p>Next are a few screenshots from the example process I used. Here, 2 people were stored as possible approvers.<\/p>\n\n\n\n<p>First releasing person:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-17.png\" alt=\"\" class=\"wp-image-438\" width=\"444\" height=\"235\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-17.png 776w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-17-300x159.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-17-768x408.png 768w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/figure>\n\n\n\n<p>Second releasing person:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-18.png\" alt=\"\" class=\"wp-image-439\" width=\"454\" height=\"163\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-18.png 840w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-18-300x108.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-18-768x276.png 768w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/figure>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-19.png\" alt=\"\" class=\"wp-image-440\" width=\"444\" height=\"124\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-19.png 840w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-19-300x84.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-19-768x216.png 768w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/figure>\n\n\n\n<p>In my workflow, I have then updated the corresponding SharePoint list entry via the action &#8220;<strong>Update Item&#8221;,&nbsp;<\/strong>in order to be able to recognize by whom the release has been made.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-20.png\" alt=\"\" class=\"wp-image-441\" width=\"485\" height=\"77\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-20.png 834w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-20-300x48.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-20-768x123.png 768w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/figure>\n\n\n\n<p>Here is an overview of the update process.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-22.png\" alt=\"\" class=\"wp-image-443\" width=\"574\" height=\"433\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-22.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-22-300x227.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-22-768x580.png 768w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/figure>\n\n\n\n<p>Finally I want to visualize the complete process:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-23.png\" alt=\"\" class=\"wp-image-444\" width=\"599\" height=\"507\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-23.png 948w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-23-300x254.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2020\/12\/image-23-768x651.png 768w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p>How cool is that \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the Covid-19 crisis, many companies were forced to send their employees&#8217; workplaces to the home office overnight.&nbsp; 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&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[8],"tags":[50,51,34,52],"class_list":["post-431","post","type-post","status-publish","format-standard","hentry","category-blog","tag-approval","tag-powerautomate","tag-sharepoint","tag-variable"],"taxonomy_info":{"category":[{"value":8,"label":"Blog"}],"post_tag":[{"value":50,"label":"Approval"},{"value":51,"label":"PowerAutomate"},{"value":34,"label":"SharePoint"},{"value":52,"label":"Variable"}]},"featured_image_src_large":false,"author_info":{"display_name":"Jan","author_link":"https:\/\/dynamiacs.com\/?author=2"},"comment_info":0,"category_info":[{"term_id":8,"name":"Blog","slug":"blog","term_group":0,"term_taxonomy_id":8,"taxonomy":"category","description":"","parent":0,"count":38,"filter":"raw","cat_ID":8,"category_count":38,"category_description":"","cat_name":"Blog","category_nicename":"blog","category_parent":0}],"tag_info":[{"term_id":50,"name":"Approval","slug":"approval","term_group":0,"term_taxonomy_id":50,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":51,"name":"PowerAutomate","slug":"powerautomate","term_group":0,"term_taxonomy_id":51,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":34,"name":"SharePoint","slug":"sharepoint","term_group":0,"term_taxonomy_id":34,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":52,"name":"Variable","slug":"variable","term_group":0,"term_taxonomy_id":52,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=431"}],"version-history":[{"count":4,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions"}],"predecessor-version":[{"id":643,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions\/643"}],"wp:attachment":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}