Run Power Apps connections with elevated permissions via Power Automate Impersonate flow actions

Run Power Apps connections with elevated permissions via Power Automate Impersonate flow actions Hello everyone reza here in this video i will show you how we can run the connections in powerapps as a different user by leveraging power automate the example here is a sharepoint list in.

Which the user only has read access but through the powerapp the user will be able to create records since the connection will run as an admin account you can think of it as an impersonation.

Step in flow so let's check it out in action the scenario is a travel request sharepoint list.

In this list i created a few columns so that users can enter the information related to the travel request to create a power app based on this sharepoint list will go to integrate.

Powerapps and create an app give my app a name and click create this will start creating a simple three screen power app that is connected to my travel request sharepoint list.

In the power app if you look at the data connection here's the connection to my travel request list in this app i can see all the travel.

Run Power Apps connections with elevated permissions via Power Automate Impersonate flow actions

Request details create new travel requests edit or delete existing travel requests in the gallery on the home screen i would like to showcase an image of the.

User who has created the travel request so i will insert an image control i'll add a connection to office 365 users i will use office 365 users user photo.

V2 this item dot created by that has the information of the person who has created this request.

Dot email and that should plug in the image of the user who has created the specific travel request all these connections that we make in.

Our power app and we can connect to any data source of our choice microsoft dataverse or pick from over 500 plus connectors that are available.

When the powerapp is published and users are accessing this power app all of these connections are made with the context of the user running the app.

Posts Related:

    There are a few exceptions like the sql

    Server connection which allows us to connect to sql with a sql server account however in general most of the data connections and our scenario here.

    Sharepoint would run under the context of the user who is running the power app now i want to share my power app to my users so the first step i will save and publish my power app.

    And to share my app on the top right hand corner i will select share this will take me to the sharing experience for my travel request powerapp.

    Here i can enter the names of the email addresses of the users who i would like to share my app with i'm keeping the scenario very simple i will share it with one user sarah.

    The important thing to observe here is when i share my app with users on the right hand side we have the data permissions and this clearly states that you need to make sure that your users.

    Have access to the data that you're connecting to in your power app in my scenario travel request is a sharepoint list so even though i share this app with.

    Sarah if sarah does not have the permissions to view update create or delete items in that sharepoint list sara will not be able to perform those.

    Actions in power apps i will go ahead and share this app so the app is now shared with sarah currently for my sharepoint site if i head over to the permissions.

    The only user who has access to the site is reza who is the owner of the site so reza has full control and sarah has no access to this sharepoint site.

    If sarah tries to access that sharepoint

    List will get a message that says you need permission to access this list and when sarah tries to access the power.

    App since this is the first time that sarah is accessing the app we can see that sata is being prompted to allow the following permissions and.

    The permissions is related to the data connections in that power app once sara allows that it will take sarah into the powerapp application in the home screen of my app sara does.

    Not see any travel requests if sarah tries to create the item it won't be able to perform that operation purely because sana has no permissions.

    Sara will require permissions on that sharepoint site so i will grant her that access i will go to share site share it with sarah and i will grant.

    Sarah edit access sara is added to my members group this time if sarah was to launch the power app sara has access to read data sara has access to create items.

    Sarah fills out the details of the travel request and click submit and we can see that item being created in the sharepoint list and the creator is sarah.

    There are various scenarios wherein in your backend data source the user should not have access to make modifications we would like to run the sharepoint.

    Connector in this use case as a different user we would like to impersonate this action folks who've done work with sharepoint designer workflows in the past there was.

    A feature called impersonation step where we could elevate the access and that's exactly what we will try and accomplish here please note the technique that i'm.

    Showcasing will work for any connector of your choice the example i've taken here is sharepoint i have this form control called edit.

    Form and when i click on this check icon it goes ahead and submits the data in this form control the form control is connected to my.

    Sharepoint list and through powerapps there is no way for me to run this connection as a different user so what i need to do here is make a change and shift the control of.

    Performing the operation of let's say creating new items to power automate now when i call my flow i need to also pass all the data that i have in my form control.

    To create my flow in the left hand side we have the option for power automate here i will select create new flow create from blank i will give my flow a name.

    The trigger for my flow here is power apps the first step i will take here is i will delete the trigger action i will pick powerapps.

    And change the trigger to powerapps v2 version 2. i need to pass the data from my powerapp form to power automate so i can create the item in my sharepoint list.

    I have various columns in that form so i would have to pass all that information over as parameters and the more number of columns the more parameters so i'll show you a neat way of using a.

    Single parameter to pass all the data in that form control in powerapps to power automate i will add an input of type text i will call this form info.

    New step create an item from the sharepoint connector pick the action create item connect to my sharepoint site.

    Pick my sharepoint list once i pick my list name it will list out all the columns that are a part of that sharepoint list so here's a neat way of passing this.

    Form information directly to the create item action for that the list name we will go to enter custom value expression.

    And type the following expression string and the parameter here will be the name of my sharepoint list i will click ok.

    This time it opens up a property called item and all it needs here is the context of the item the schema has to match the schema of my sharepoint list.

    This parameter is of type string although the information that i would be passing would be in json format so i need to typecast the string to a json to do that.

    Expression json with my mouse pointer right in between these two brackets i will head over to dynamic content and pick my parameter.

    Form info i will click ok this completes my create item action i'll take one more action here and that would be to notify my hr admin that a.

    New travel request has come in so i'll add a new step send an email office 365 outlook connector send this email to my hr admin james.

    The subject new travel request and at the body of the email i would like to put the details of the newly created travel request.

    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=ts-ggDAy7IQ
Previous Post Next Post