@kkittinger When using the OneDrive for Business connection the browser-stored credentials are accessed to create connections, which should give you access to the personal folder of the "connection owner" (see screenshots below). Are you trying to access *other* users personal folders, or the personal folder of the user that was used to create the connection?
My OneDrive Folders:
NWC Connector under my credentials:
@butlerj thank you for replying to this. Hope my explination helps in this.
So we have tried to make connectors to the individuals OneDrive for Business and get an error message that the connector couldnt be built (screenshot below). We get this error wether the admin signs in or the employee does. Only time we are able to make a connection is when we go to our defualt area for OneDrive for Business (<tenant>-my.sharepoint.com) using Admin Login. All our employee OneDrives are built under this as site collections /personal/<users>. Our Admins have rights to all these as site collection admins. So in a way yes, we would be trying to access *other* users personal folders/OneDrive to either grab the template or put the file built.
To note our licences are for Office and SharePoint Online. So as new employees are onboared and after we migrated to the cloud it build employees MySites and tied there OneDrives to that. Not sure if this effects how the connector actually behaves.
@kkittinger I've done a little digging into this and I believe that this is a restriction with how the OneDrive Graph API functions, as I've done testing with both our actions and the Power Automate OneDrive integration and both work the same way.
When making a connection to OneDrive for Business you do need to connect to the tenant URL (<tenant>-my.sharepoint.com) and that will create a connection to OneDrive with the credentials of the user making the connection. This will give that connection access to that user's personal OneDrive folder, but does not give access to other user's personal folders (even if the connecting user is a tenant Admin). The only way to get direct access to another user's pesonal folder is to create another connection using that user's credentials, which can then be used as the "target" for delivering files.
Given that you cannot programatically create and access new connections while the workflow is running, I believe you will need to take a slightly different approach to your use case. I would suggest something similar to what I've outlined below:
- Create a connection to OneDrive using a dedicated Service Account
- Within the workflow create new folder with the employee's name
- You can then DocGen the file to this location
- And finally you can share the new file with the employee
Let me know if that helps!
@butlerj Thank you for the reply.
This is what i was figuring as the connector is set up like the Google one where individual users would have to log on to access those certain areas. This makes it very clear on this matter.
I have two additional question for you one of which I think I already know the anwser to based on what you have provided.
- Even though connector is set to a certain person, can you still make the output of the Document Generation go to either another users OneDrive or to a specific file location?
- We have noticed and I tested this with myself and one of our techs that has Domain Admin rights, that when I sign into the connector I see my OneDrive area but we out tech does it only shows the tenant admin area and not their OneDrive. Is there something different for people that are Domain Admins?
Thanks again for all the information.
Kevin