cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
illmatic
Helper IV
Helper IV

Send http request to SharePoint -- Access denied for users with edit rights

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...

 

flow-sendhttprequest.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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?

8 REPLIES 8
annajhaveri
Super User
Super User

How is the flow triggered, what is the trigger of this flow, is it powerapps or something else?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

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??   

annajhaveri
Super User
Super User

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.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

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.

annajhaveri
Super User
Super User

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,

Anna Jhaveri

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

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.

illmatic
Helper IV
Helper IV

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.


  • In parent flow, initialized a variable
  • Used 'Get Items' SP action to query list I needed dynamic content from.
  • Used 'Apply for all' action and input 'value' of previous action.
  • Set 'condition' if Title value in ListA matched Title value in ListB, then set variable to URL from ListB.
  • Used 'Respond to PowerApps' action, added 'text' output.  
  • Created 'returnMsg' as variable and set text to 'variable' 
annajhaveri
Super User
Super User

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

 

Screenshot 2020-12-18 131003.png

 

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

Screenshot 2020-12-18 131004.png

 

Then you can assign the data from ParseJSON action to variable

annajhaveri_0-1608285178987.png

 

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

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (68,609)