web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

Copilot Studio + Agent flow : When using create file into onedrive - User credential question

(1) ShareShare
ReportReport
Posted on by 13
Hello
 
I have created an agent flow, and then i have attached it to an agent.
 
Inside my agent flow (screen below) i used the one drive "create a file" because what i do is getting a lot of data from my copilot studio agent, i use then this agent flow to create a excel file with a prompt tool and then : I want to save it to the connected user in copilot studio one drive personnal space
 
my question : 
 
Will the file created always in "my one drive" because i used my connexion in the agent flow ? Or will it use always the connected to agent user credential to connect to the user one drive and create the file in the one drive of the user ?
 
 
i could provide more information if needed :)
Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    51,852 Super User 2025 Season 2 on at
    Copilot Studio + Agent flow : When using create file into onedrive - User credential question
     
    It is going to run as you. While its (default) that if you look at the flow IN power automate it will show under run-only user, that it will use the provided by user, it will not.
     
    It will use yours.
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • Verified answer
    CU08041831-0 Profile Picture
    13 on at
    Copilot Studio + Agent flow : When using create file into onedrive - User credential question
    hello
     
    Thanks, but i m no speaking about power automate
     
    It's an agent flow : the menu like in power automate to change or this don't exist : 
    i think you speak about this in power automate
     
    in agent flow you only have this 
     
     
    and what's curious for me is when i deploy to Teams i have to approve all of this 
     
     
    And if understand what you say
     
    If i m "USER A" and "USER A create the agent flow".
    When "USER B" will try the agent in his own team : he will approve the connexion "for nothing" ? and it will use connexion from user A ? So User B , when running the agent, the flow with the one drive connector will still try to connect to user A one drive ? 
     
    #EDIT Later 
    I manage to create a test tenant with 2 user
    i made the same flow as above (and i add the sharepoint create file connector too for testing)
    I call the flow from copilot studio for both user.
    It created file with different owner in sharepoint
    It created file with different owner in one drive and used the http request connector with connected user to get the URL of the onedrive
     
    So thanks for all the help, it work as i supposed , i posted my solution for sharing :)

    To summarize : 
    Agent flow will use the connected user to the agent credential for those connector at least :)
  • Michael E. Gernaey Profile Picture
    51,852 Super User 2025 Season 2 on at
    Copilot Studio + Agent flow : When using create file into onedrive - User credential question
     
    To clarify something :-)
     
    1. The flow you see in your Agent, is in power automate, they all are. I was simply pointing out that it would need to be set to (what you have it is), which for some connectors it's not supported, fortunately for that one it is.
     
    2. I thought your ask was to write to THAT users (sharepoint/onedrive) which is different than everyone having access to the same location.
     
    If you wanted to write it to a different location meaning
     
    User A writes to user A location (in their own) and User B writes to user Bs location (in their own)
     
    So there was some confusion so both things are true, I jsut thought you were asking something else.
     
    Let's pretend you wanted to write to User A's for User's A's OneDrive/Document library, then you would use Get Profile V2 to get the user who triggered the Flow (which I know it says Agent Flow but it is completely a flow that you can go into the back end and look at), their MySite value and then dynamically write it to theirs.
     
    For User B you would do that and dynamically write to their (User B) location.
     
    It looks like you are simply writing to the same location for everyone but you want to make sure it writes it (Created By) the User who called the flow :-)
     
    So it's just another Pivot on what I thought you wanted.
     
    note: again not all connectors will allow this and will require you to do Delegation via Graph API :-)
     
    Just not in this case.
     
    Whew hehe so two great minds think alike just a little different hehe
     
    Cheers!!!
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 475 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 425 Super User 2025 Season 2

#3
Giraldoj Profile Picture

Giraldoj 55 Super User 2025 Season 2

Last 30 days Overall leaderboard