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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Apps Excel Uploa...
Power Automate
Suggested Answer

Power Apps Excel Upload to SharePoint Document Library Fails

(0) ShareShare
ReportReport
Posted on by
I am uploading an Excel file from Power Apps using an Attachments control and passing it to a Power Automate flow (Power Apps V2). In the flow, I try to create the file in a SharePoint document library using triggerBody()['file']['contentBytes'], but the flow fails saying the file property cannot be selected. Older or duplicated flows work, but newly created flows fail. I need the correct approach to upload Excel from Power Apps, save it to SharePoint, and then read the Excel data.
 
powerapp:
testcreateitem.Run(
{
ContentBytes: First(DataCardValue11_1.Attachments).Value,
name: First(DataCardValue11_1.Attachments).Name
 
}
)
 
 
Error
Action 'Create_file' failed
Unable to process template language expressions in action 'Create_file' inputs at line '0' and column '0': 'The template language expression 'triggerBody()['file']['contentBytes']' cannot be evaluated because property 'file' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.
Screenshot 2025-1...
Screenshot 2025-1...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (3)
  • Suggested answer
    Assisted by AI
    MParikh Profile Picture
    328 Super User 2025 Season 2 on at

    Your flow is looking for triggerBody()? ['file']['contentBytes'], but the Power Apps (V2) trigger is not giving you a file object named file. Older templates did. Newer ones often expose the inputs at the root, or under a different parameter name, so “file” cannot be selected.

    Fix pattern
    1. In Power Apps, pass two plain parameters Use the attachment’s Name and Value.
    Power Apps test create item. Run(First(DataCardValue11_1.Attachments). Name, First (DataCardValue11_1.Attachments). Value)
    1. In Power Automate, change the trigger to match the Power Apps (V2) trigger Add two inputs:
    • FileName (Text)
    • FileContent (File) or Text (base64)
    If the trigger input type supports File:
    • Map FileContent directly from the Power Apps parameter.
    • In Create file, use: File Name = triggerBody()? ['FileName'] File Content = triggerBody()? ['FileContent']
    If the trigger input is Text (base64):
    • Create file expects binary, so decode: File Content = base64ToBinary(triggerBody()? ['FileContent'])
    1. Stop using triggerBody()? ['file'] paths In the Create file, pick the dynamic content tokens from the trigger input fields, or refer to triggerBody(). ['FileName'].triggerBody()? ['FileContent']
    2. Validate what the trigger sends. Run once. Open the trigger step and show raw outputs. You will see the real JSON shape. Use those exact property names in expressions.
    Common gotchas
    • Do not pass First(...). Value as ContentBytes. Pass it as the file content parameter, then decode only if your trigger treats it as text.
    • For large Excel files, the Power Apps to Flow payload size can break. If the file is big, upload it to SharePoint from the app (or use a chunked approach), then pass the SharePoint file identifier to the flow.
    Working on an end-to-end approach for “upload, then read Excel” A) Power Apps sends file name + file content B) Flow creates the file in SharePoint. C) Flow uses Excel Online actions on the created file (Get tables, List rows), using the file identifier/path from Create file output, not a hardcoded path

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard