How to Build Custom Approval Forms in Power Apps

How to Build Custom Approval Forms in Power Apps Hello everyone razza here in this video I will show you how to build a custom approval form process in power apps we will orchestrate the entire approval process from within power apps by using.

How to Build Custom Approval Forms in Power Apps

The form control sending notifications to approvers and design an approval process where an approver can pick the next approver in sequence so let's go ahead and check it out in action.

[Music] I have a SharePoint list called expense request list since I'm trying to design an approval process I would like to.

Maintain the information about the approval and for that I have added additional columns to my list the First Column that I have added is called approval.

Status it's a choice column that has three values pending approved and rejected the default value I have set as pending meaning any new expense that is created the approval status will start.

From pending I also have a person type column called approver here I will store the details of the current.

Approval approval commands is a column of type multi lines of text and finally I have a column of type multi-line of text called approval history this is where I would like to.

Store the entire history of the approval process whenever an expense is submitted the first approval would be the users's manager the manager can take the approval.

Decision either approve or reject or transfer the approval to another approver that they can do by selecting who the next approver is let's go ahead and build a power app.

That will connect to that SharePoint list I'll start with a page design I leverage the design gallery connected to sh SharePoint I'll select this creates the.

Connection I can put my SharePoint site URL connect and pick the SharePoint list I'll click create app this will begin the process of.

Creating a single screen power app experience that will allow the user to perform full crud operations create delete update and delete against that connected expense request.

Posts Related:

    List here's the app I can click on new

    The form experience lights up which allows me to enter the expense details now let's make modifications to this form.

    Experience in the main container is where the form control is placed columns I'll set to three so this will place the columns in a three column.

    Format I also have the option to reposition The Columns in the form I've gone ahead and done that for the form Fields I'll go and insert a custom.

    Card I'll use this to create a sectioned experience in the form I'll position this card right before the approval columns expand its width reduce its.

    Height and in this card I'll insert a label control I'll call this approval information now when the user is creating a new expense.

    Request approval status by default will be set to pending so this data card should not be visible if the form is in new mode the approval status data.

    Card visible property I'll change this to my form control which is called form one. mode is not equal to form mode. new so notice the approval status column.

    Is hidden when the user is creating a new item approver who should be the current approver for the expense.

    Request when a new item is being created this should be the current users manager to do that I'll go to data add data and use the Office 365 users connector.

    This connector has a function that

    Allows me to get the manager details that I would like to store in a formula the app object has a property called.

    Formulas so I'll give this a name I'll call it user manager and its value will be Office 365 users dot manager V2 and it requires the ID of the current.

    Logged in user that we can get from the user function that exposes a property called entra object ID so this will get me the current users.

    Manager information and this is what I would like to plug in as the default value of the approv data card to make changes to a data card we.

    Have to first unlock the data card and I would like to change the default property depending upon the mode of the form I'll switch on form. mode if the.

    Mode is form mode. new then I would like to put the current users manager for now I'll use the named formula which is user manager.

    Else I use this item. approver format text user manager if you explore it has gone and picked my.

    Manager information from ad but the data card is not defaulting to my user that's because approver is a person type column I wrote a blog post around how to patch data to SharePoint.

    And in here I covered different types of SharePoint columns and one of them is the person column the way we set values for the person type column is as follows so I'll simply go and copy.

    This go back to my power app approv a data card default value instead of user manager I'll just paste that code format text now now it shows a value for the.

    Approver it's the current logged in user itself which is me Raza but I need the manager information all I have to do replace the user object details with the information.

    Coming from my named formula user manager here I need the email I'll use user manager. mail here I need the full name user manager. display name.

    Here as well I need the email and if You observe the data card it has defaulted to my manager which is Sarah now this data card is something that I do not want to allow the user.

    Creating the request to change the data card has a property called display mode let's change this as follows if the mode of my form is edit then you respect the display mode.

    Of the form else you set the display mode to view so now I cannot change it approval commands should only be visible to the approver which would be the user editing the item so the visible.

    Property my form. mode is it equal to form mode. edit currently it's a new form so it's hidden for approval history this is where I will track the entire process of my.

    Approval I'll unlock this card it's default value I would like to change as follows if this is a new form I would like to plug in details in the approval.

    History around who this approval is assigned to I'll create this demarcation now gives me the current date and time use the same.

    Demarcation it's a simple string ENT allows me to concatenate string double codes enter to go to a new line approval assign.

    To the users's manager comma if it's not the new form just keep the original value format text this data card just span its.

    Width and preview current date and time approval assign to whoever the approver is this data card is not something I would like to show to the user when they.

    Are creating or editing the item so the visible property I will set as form. mode is form mode. View so at this point if I was to preview the.

    App when a user clicks on a new expense request they get the expense form to fill out any mandatory fields that I've defined in my SharePoint list will be.

    Respected the approval info section will only show me the approval to begin with and please note none of the approval columns I have set as mandatory in my data source I will handle the mandatory.

    Law loic later when the approver comes into picture in the app so at this point the user can submit an expense request the user can also attach files as part of the expense.

    Request and submit the request the expense request is created I can view the details of the submitted request the approval status is pending.

    The approver is Sarah and the approval history has started tracking the information when we submit the form we would need to send an email notification to the.

    Approver whenever data is submitted in the form control and when it does it successfully it will trigger a property in the form control called on success this is what the formula looks.

    Like this is where I would like to send the notification email to the approver the email should go to the approver if the approval status of the request is.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continuetomake videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=cyDyBTBW5Z8
Previous Post Next Post