I have looked everywhere to try and resolve this but cannot work it out. I have a Flow set up where it copies an attachment from a SharePoint List to a SharePoint Document Library. Once it is in a Library, I am trying to make another flow using the PowerApps v2 trigger that reacts when a button is pressed. The button is linked to a PowerApps Gallery that lists people's names and an .docx attachment. I would like to move the file of the selected person from one folder in the SharePoint document library to another. I first tried 'Get Files' and 'Get File Properties' instead of using the PowerApps trigger, but it moves all the files in the folder, not just the one that is linked to that person. I've since found a different way to do this using the PowerApps trigger, and to a certain extent got it working.
I have used this code in OnSelect in PowerApps:
Sorry. Should have explained that I have tried that, and I receive this error:
Unable to process template language expressions in action 'Create_file_2' inputs at line '0' and column '0': 'The template language expression 'triggerBody()['file']['name']' cannot be evaluated because property 'file' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.
This is the setup:
I also tried this syntax in your first response but PowerApps would not accept it:
Hi, @Strikerman10
You do not need to create the Name parameter in your Power Apps V2 trigger:
You can refer to my first reply and you can try to use this code in your app:
MovetoRejected.Run(
{
File: {
contentBytes: First(DataCardValue22_1.Attachments).Value,
name: First(DataCardValue22_1.Attachments).Name
}
}
)
If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance!
Best Regards,
Yueyun Zhang
I've tested this and this is what I get:
Action 'Create_file' failed
The provided workflow action input is not valid.
I tried using a different address to create the file in, but that did not work either.
I had to change my formula in PowerApps to this to get it to work. It would not allow me to use your suggestion above where you added, First(DataCardValue22_1.Attachments).Name as it created 3 errors in the formula.
We expected an operator +, * or & at this point (2 errors) and also Invalid number of arguments, expected 2 received 0-1.
The formula that was accepted was:
Hi, @Strikerman10
Thanks for your response! This is strange , in my thought it will not affect the end result. Can you try to directly test the flow in Power Automate side? And show the screenshot in your flow run history.
And you need to check your connection in your flow.
Best Regards,
Yueyun Zhang
@v-yueyun-msft thank you for your help. Unfortunately I could not get this to work. I think the formula was ok, but the flow kept giving me an error '403 Access Denied' when using 'Create file' action. I am not sure why this is, as I am the owner of the SharePoint List and Library that I am using. When I remove the file name being pulled from PowerApps and instead insert a static file name in the flow instead it works. This is the setup when it is working:
This is the setup that fails with the access denied error when trying to pull the filename from the PowerApp
Error is:
Access denied.
clientRequestId: 75df81de-fda0-4f36-979b-0c847aff927b
serviceRequestId: 75df81de-fda0-4f36-979b-0c847aff927b
Any ideas on what is happening here?
Hi , @Strikerman10
According to your screenshot , you put two parameters (File Content and the File Name )in Power apps V2 trigger.
So you need to pass two parameters in Power App side, like this:
If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance!
Best Regards,
Yueyun Zhang
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2