Announcements
Hi,
I have a simple requirement to copy a file from one document library to another library in SharePoint. I want to achieve this via click of a button on PowerApps as we dont want to expose entire SharePoint to users?
Has anyone done this? Thanks in advance.
Thanks,
Santosh
The problem with your scenario is that the user running the PowerApp would need to have permission to both libraries to do the copy even with a Flow. A Flow that is started from a PowerApp runs in the context of the user running the PowerApp. So to copy a file using a Flow you would need to have access to both libraries. I assume that is not what you want since you talk about exposing SharePoint to all users. There are workarounds, but they cost additional money in terms of licensing and usually lead to an overly complex system. PowerApps and Flow really aren't designed to function with SharePoint without giving users access to the underlying data.
Providing access to both libraries is not a concern. We want to provide a simple layout for end users to use rather than lenghty sharepoint list. I checked other posts on this forum and saw some people achieved it. I am currently struck work ID issues which is not being pulled from Powerapps to FLOW. Any help on this is appreciated.
To pass a paraameter for the flow when you click the button edit the flow, initialize a parameter of the data type that you need and pick Ask in PowerApps from the dynamic content list to set the value of the variable. This will create a parameter for the Run statement in the onSelect button in Powerapps. Just add the value to the run() in PowerApps and you will now have the data in Flow. After that it will show up in the Flow dynamic content, and you can delete the variable if you want. The variable is just a way to make sure you get the correct data type when creating the parameter.
I tried the steps you mentioned and hit a roadblock. That is due to my limited knowledge on FLOW and Powerapps and in general.
Attaching the steps i used here and let me know if i am missing a step.
Are you trying to copy a file from a library or attachments from a list item? For attachments you need to supply the ID of the List Item as the parameter from Powerapps. That's an integer. Then you can use the Get Attachments action to get the documents. It looks like you have Powerapps passing the actual document.
Hi @Santosh_M ,
Could you tell us about the main features of the app? Could it submit an item id?
As described by @Pstork1 , if you want to get the attachment contained in the specified item, you need to get the specified item id.
Then configure the following Action, you could get all the data directly through the ID.
Like:
Best Regards,
As asked earlier is the file stored in a document library, as a list attachment, or somewhere else like their local hard drive or a network share? The Flow is a little different depending on where the file is stored. If you'll provide that information I'll walk you through how to pass the parameter from powerapps and what the flow looks like.
Thanks all for the help. It helped in solving the issue. Also i had to tweak a bit of my PowerApps Run option to include the ID.
The app is a simple one. User has to select the relevant file from dropdown and then click submit. Then the flow will trigger to copy the selected file to another document library. Attached is the image for the same.
@v-bacao-msft wrote:Hi @Santosh_M , Could you tell us about the main features of the app? Could it submit an item id?As described by @Pstork1 , if you want to get the attachment contained in the specified item, you need to get the specified item id.Then configure the following Action, you could get all the data directly through the ID.Like: Best Regards,
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 248 Super User 2026 Season 2
WarrenBelz 192 Most Valuable Professional
Mohsin Ali 135