cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amcneil32
Resolver I
Resolver I

access denied on OneDrive folder

Hello, I created two flows for an end user. The first creates a OneDrive file from a new outlook email. The second flow takes that attachment and creates an excel online table. This worked fine as I tested with my credentials. I shared the flows with the end user and successfully added their account for each connection. The error below says access denied though. I have both flows pointed to the same OneDrive folder and have confirmed the folder exists for the end user. Little confused how the first flow runs successfully with the end user's credentials, but the second doesn't. thanks for any thoughts. 

 

** an extra thought. the end user I doubt has used OneDrive before. They do have a subscription. I'm not sure if them logging in might have something to do with this? I'll run a test on this**

 

**update- the flow failed with the same error as below**

 

 

amcneil32_0-1615473923754.png

 

 

 

 

 

amcneil32_0-1615474163455.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Did you select the folder again when you deployed it under the user account? It displays the folder name, but on the background it's the folder unique ID.

image.png

That means that even if it displays the same folder name, it can still reference your folder by the unique id on the background.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

6 REPLIES 6
tom_riha
Super User II
Super User II

Hello @amcneil32 ,

I'd try to export the flows and then import them under that user's account. That way you'll completely avoid the possibility that your connection stayed somewhere on the background.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi @tom_riha,  thanks for reply. I previously exported these flows. I then had the user log in. I have confirmed that every connection in the flows are using the end user's credentials and not mine. I also confirmed that the first flow accessed the end user's onedrive and did indeed create the file. For some reason the error exists only in the second flow that should be looking at the just created file. 

Did you select the folder again when you deployed it under the user account? It displays the folder name, but on the background it's the folder unique ID.

image.png

That means that even if it displays the same folder name, it can still reference your folder by the unique id on the background.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

that makes sense. I'll have to select the folder again. I do have actions in the flow that reference the File ID which comes from that folder. Will those need to be modified as well? thanks

Once you get the file ID from the OneDrive you'll be fine, the ID is a dynamic value for each flow run (unlike the folder that's fixed).



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

In the end I had to delete the action and recreate it while logged in as the end user. Just selecting the folder gave two folder IDs in the JSON code. I then had to add back the File ID dynamic content again in three different steps. The flow gave me another access denied error, this time on the next action. I'm assuming the location and document library are still linked to me in some way? I can recreate these actions and perhaps that'd solve the problem. I'm having to screen share with the end user to accomplish this so it's a little difficult to go back and forth trying to test this out. Unless you can think of another option I'll go that route? thanks 

 

amcneil32_0-1615499837947.png

 

amcneil32_1-1615499859633.png

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,243)