I have a Flow that creates a subsite on a SP site collection based on user input from a list. The flow works as expected when I, a SCA, Site Owner and SP Admin, submit the form. I have an end user with 'Edit' permissions on the site collection who receives an access denied error. Here are the details of the Send Http Request to SP...
Is there any way the request can be fulfilled under user credentials that just have edit rights or is there any kind of access token I can generate that passes my credentials?
How is the flow triggered, what is the trigger of this flow, is it powerapps or something else?
Hey there, it's triggered by PowerApps. My understanding is that PowerApps runs the flow under the context of the user who is accessing the PowerApps. Since they don't have the same rights I do, this is why they're hitting the Access Denied. I guess the workaround is to change the trigger to the SP list, and perhaps save the response from the REST call into two variables, one for success and the other for an error? Then use those variables to update a column in SP list, and bring those values into the PowerApps form that way??
Yes your understanding is correct. when flow is triggered from PowerApps the flow runs under user context. You can create a new parent flow, which will call your actual flow, so you can call parent flow from PowerApps, and the parent flow calls the actual flow, this should resolve your issue, without making many changes. If your flows are in solution then you can use Call Child Flow action to call one flow from another flow. If you are not using solutions, then you can use http action to call a flow from another flow.
Oh, thank you Anna for the guidance. May I ask if I go this route, would I still be able to do a Respond to PowerApps action in the child flow to capture data and send back to my PowerApps or does this need to happen in the parent flow? And do I need to add connections for both of the flows to the PowerApps? For me, I would be using the latter method to call with an http action.
Hello @illmatic ,
In order to return data from flow, you need to return using Respond to PowerApps/Flow action in both flows, to get the value back in PowerApps. You need to add connection for the Parent flow only to the PowerApps.
Thanks, I have added the action to both Flows, but I think I'm a tad hung up on how to get the value of my input from the child flow into the parent flow. My use case is, in the Child Flow, the output is a string variable which contains dynamic content which is only available in the child Flow.
In the Parent flow, when I do the response, I don't see a way to call the output saved in the Child flow.
In case anyone falls upon this thread with the need to display dynamic content from their child flow into their parent flow, the method I used is as follows.
okay, so you were able to return the value from child flow to parent flow and from parent flow to PowerApps.
In case if you need further clarification, below are screenshots you can include dynamic content to return value using respond to PowerApps/Flow
Also as you would be using HTTP to call the child flow, in order to get value returned by child flow, you can use ParseJSON action to parse the value returned to HTTP request action
Then you can assign the data from ParseJSON action to variable
Once you have the value returned by Child flow in variable of Parent flow, you can again use the Respond to PowerApps action to return the value from parent flow to PowerApps
Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
Check out the new Power Platform Community Connections gallery!
Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.