How to Request an Approval Process from Power Apps | Full Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone razza here in this video I will show you how to create an approval request directly from power apps the user will be able to select the approvers from within the power app that will begin a sequential approval process and as the approvers respond the entire approval details will be showcased directly in the power app so let's check it out in action to request an approval process from a power app in my scenario the data source is a simple events information list in SharePoint for the approval process I need a certain set of columns I'll add a column of type Choice I'll call it status I've gone ahead and plugged in three options pending approval this will be the default status the moment an item is created in this list and then based upon the final approval decision the status would either be approved or rejected next I'll add a person type column I'll name it approvers go to more options and allow multiple selections then I'll add another person type column called assigned to next I'll add a multi-lines of text column call it approval history and finally a column of type number I'll call it decision taken and the default value for this I will set it as zero that completes the columns that I need to manage the approval request process in my power app I have the SharePoint list connected and on my home screen I'm leveraging the modern table control to show the items from my events info list this can also be a gallery control Now to create a screen that allows the user to enter information into my events info list as well as track the approval request information I'll head over to new screen and one of the new modern screen templates is called approval request I'll go ahead and select this in in this template we have a form control I'll go ahead and connect this to the SharePoint list to connect the home screen with the form screen in the home screen I have a button called add event on select of this button I will first reset the form the form called approval form one in my case which is in the form screen and then navigate the user to my form screen the table control has a property called on select I will set a variable called V item and its value will be my table controls name do selected then I will use the view form function my form called approval form one and then I will navigate the user to my form screen click add event takes me to my form screen to allow the user to go back to my home screen in the header control there is an option to place an image in the logo property I already have an image uploaded in my app called back and there is also an on select logo property here I will use the function back so I can click on this to take me back to the home screen if I click add event I have the ability to add a new item in my events and full list and I can do that by clicking on this button called submit request which is a part of the template so it submits the form and the form control has an on access property so when the event is successfully submitted in that case I would like to navigate the user to my home screen approvers is my person type column multi select and we can see that the modern combo box control does not work well with person type columns so we will make a slight adjustment here temporarily I'll go and insert a new screen blank one and in here I will insert the classic edit form control connect it to my SharePoint list this form will leverage all the classic controls here is the approvers data card and here is the classic combo box control right click copy go to the approval request screen select the approvers data card Advanced unlock select the modern combo box delete right click paste here comes the classic combo box control I'll go and copy the name of this combo box and the two errors that are occurring here all I have to do is use the reference of the classic control that I just pasted here so I'll just replace the names and I'll do the same for the other properties since this is the classic combo box control if I head over to properties and Fields Primary text I can show display name search text I'll also use display name click preview and now I can use this to search for users in my active directory here the user is selecting the approvers and we can make this data card a required field by simply setting the required property to True assign to when the user creates a new item this should hold the value of the first approver that is entered in this multi select person type column so for the assigned to data card I'll first go and unlock and for its default property I will use the formula if the approval form. mode is form mode. new then go and get the first value from my classic combo box control that I added here else you keep the value as it now this is a modern combo box control if I head over to properties and Fields I'll go and add a field here to show the display name if I preview notice it picked Resa because resa is the first approver here let's remove Resa now there Sarah and this data card for assign to has a property called display mode I will change this to display mode. disabled as I do not want the user to make any changes to this the sidebar container we have this Gallery control that represents a status indicator like experience for your approval process this entire sidebar container should only be visible if the form control is not in new mode so to this existing formula I will append an or condition approval form. mode is equal to form mode. new the sidebar container is not visible because currently the form is in new mode the user can fill out the form select the approvers submit the request and at this point I want to start an approval process we will Leverage power automate I'll create a flow that's of type automated Cloud flow where the flow will trigger when an item is created or modified in SharePoint I'll give my flow a name and click create for the trigger I'll pick my SharePoint site and pick my SharePoint list next I'll add an action pick the approvals connector and select start and wait for an approval approval type I will pick first to respond the title of the approval I'll say event approval for the title that the user entered assign to this I can directly Leverage The assigned to person type column that has the information of the first approver I'll pick the dynamic content assigned to email now once the approval decision is taken I'll add an action compose action and here I'll use an expression I'll use the function add go to Dynamic content and select the column value for decisions taken and to this I'll add one I'll click add rename to decisions taken then I will add an action which will be a condition to check to see if the outcome of the approve approval is this equal to approve if yes I will add an action to update the item in my SharePoint list once again I'll pick my SharePoint site and my SharePoint list ID the dynamic content ID of my Trigger action Advanced parameters I'll click show all so the this will list out all the columns status value this I will want to set conditionally depending upon whether this is the last approver in the approval chain to do that I will enter custom value and write an expression if equals the length of approvers Dynamic content this is my multi- select person type column length will give me the number of approvers that the user had selected if this equals the outputs Dynamic content of decisions taken that means this is the last approver in the thread in that case I will set the status to approved else I will keep the status as pending approval these have to exactly match the status column values we placed in our choice column I'll click add assigned to claims here we need to put in the value of the next approver in the chain enter custom value expression if equals length approvers if this matches decisions taken meaning this is the last approver in the chain in that case I need to set the value of this person type column to null unfortunately we can't do that here we'll need an extra step for that so for now I will keep the value as the same value of assign to by picking assign two claims else meaning there are more approvers so I need to go and pick the next approver for that I'll go and pick Dynamic content approvers which is my multi- select Choice column from here I need to pick the next approver so I need to give its index question mark under square brackets I'll simply put the outputs of decision taken as that has the running number and from here go and pick the claims token so this will dynamically assign the next approver I'll click add decision taken this is straightforward I'll pick the outputs of decision taken approval history first I'll add the existing approval history I'll put a demarcation approved by I need the name of the approver who approved it I'll use the following expression to get that value for commands once again I'll use an expression to go and grab the value of the commands that the approver entered so this goes ahead and updates the item now at this point it's important to understand that my flow triggers when an item is created or modified and in this flow itself I am modifying the item which will result in the flow triggering again which I would like to do if the status of the approval continues to be pending approval so for the Trigger action if I go to settings I have an option here for trigger conditions this is where I can add a condition to only trigger the flow when I need it and I would like to trigger this flow only when the status column which is a choice column its value is pending approval now I updated the item but one thing that did not get completed is for assigned two if it is the last approver assigned two should be empty but I cannot do that in this step there is a limitation in the update item action so right after this I'll add another action which will be a condition condition will be equals length of approvers with the outputs of decisions taken I'll add equal to expression true this is a Boolean true so this checks to see if this is the last approver in the chain if yes I need to set assign two to empty and for that I will add an action use the send an HTTP request to SharePoint action connect to my SharePoint site method will be post API web lists get by title in single codes I need to put the name of my list exactly the way I have the name slash it items and here I need to get the specific item that I'm trying to update so I'll simply pick ID I'll pick it from the trigger show all in advanced parameters some setup needed here content type accept if match and the type of the HTTP method is going to be merge and in the body I'll start with this format type is sp do data dot the name of my list if there is a space in the name of your list you have to replace it with underscore x0020 uncore and at the end right list item comma the property that I want to update is my column called assigned to if I simply sort on this column in the URL I can get the internal name of this column assign to so here I will place that name i d iaps d lowercase colon under double quotes the value minus1 that's how I can set that person type column to empty this completes my true Branch if the approver says approved if the approver says rejected I have to do something very similar to what I did for the first step here which is update item so I'll simply copy it go to the false branch and paste here the details are going to be similar the status value straightforward I can directly pick rejected approval history instead of saying approved by I'll change this to rejected by assign to claims here I don't need to set the next user in fact I don't need to set it at all so I'll just delete this and X I have to make it empty and for that I have to use that same HTTP request action and that action is right here so once again copy paste and this completes my workflow I'll click save my flow is saved but I'm getting a warning that this flow may result in an infinite trigger Loop but I'm not worried about it because I have handled it thanks to trigger conditions flow is ready my app allows the user to submit the data so let's go ahead and create a new event approvers I'll pick Sarah and Resa I click submit the data gets recorded in my data source here is that item if I click on this it takes me back to the request approval screen notice it did not show the data in the form that's because the item property of the form I simply need to set this to ver item that's the variable I set when I select an item in my table control and if I preview I can see all the details submit request button should only be visible when the user is submitting a new request so the visible property of that button I'll set it to approval form mode is form mode. new now the sidebar panel shows up and here I would like to list my approval information there is a gallery control its items property I will set as follows all I'm doing here is go grab the approvers from my variable and go and add a step number to each approver so if you look at the output of the action it has the details of the approvals and it has the step number now there are a few errors here the first text control font weight I'll just set this to regular and the text I will set as this item dot display name so that'll be the name of my approver the second text control font wave I'll set to regular and text will be this item dot Department the approver belongs to then we have this badge control I'll change its style to fi content I'll set it to empty base pallet color I will set to the following formula if the current email address of the user is this equal to the current approver who the task is assigned two if yes show it in a specific color then check to see if status is rejected set the color if no then accordingly go and check to see how many decisions were taken and set the colors so if I preview this right now the task is assigned to Sarah who's the first approver and then it will go to Resa who's the next approver now in this Gallery there is also a rectangle shape control I'll go and set its withth to three so it kind of shows this interconnection of the approval chain and if you would like to put an image of the approver as well select the gallery click edit and go and insert and image control the image property should be this item. picture I will go and place this right on top of this batch control Sarah is the first approver Sarah receives an email asking for an approval for the event that was submitted Sarah can approve or reject directly from the email itself enters commands submits her response action completed in my power app I refresh I can see the status is still pending approval but this time the approval task is assigned to Resa who is the second approver in the process Sarah approved so this is green now it's pending resa's approval here is the approval email that Resa has received Raza also approves it puts in his commments submits his response and now in the power app the status changes to approved assigned to 2 is empty and if I explore the item here is approval status indicator well let's also show the approval history in the sidebar container I will go and insert information button modern control I'll move it up the content property for this control I'll leverage my variable dot approval history preview if I click on this there is the entire approval history first approved by Sarah these were the commands and then approved by Resa and these were the commands I'll add a new event status column default if the form is in new mode put the value pending approval approvers I'll pick three this time and submit company event pending approval assigned to the first approver Sarah Sarah approves it so it's green now the task is with James we can see the approval history James rejects it I can clearly see the approval status if you enjoyed this video then do do like comment and subscribe to my YouTube channel and thank you so much for watching
Info
Channel: Reza Dorrani
Views: 39,855
Rating: undefined out of 5
Keywords: powerapps approval, powerapps approval screen, microsoft power apps approval, powerapps multiple approvals, how to create an approval workflow in power apps, power automate approval workflow, power apps, approval, power automate, powerapps, microsoft, reza dorrani, how to, tutorial, power automate approval, power platform, flow approval, powerapps approval workflow, powerapps approval flow, power apps approval process, approval request, approvals, sequential approval, learn
Id: UE2U2NnmBUI
Channel Id: undefined
Length: 27min 4sec (1624 seconds)
Published: Mon Apr 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.