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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The function 'Run' has...
Power Apps
Unanswered

The function 'Run' has some invalid arguments with SharePoint upload.

(0) ShareShare
ReportReport
Posted on by 38

Hi everyone, I kinda need support here. 

After many attempts, I've been trying to get the following OnSubmit to work:
Code:

UploadFileOnSharepoint.Run(
{
FileName: First(DataCardValueUpload.Attachments).Name,
FileContent: First(DataCardValueUpload.Attachments).Value
}
);


I have the following inputs in my automate flow:

- FileName  (Takes in the file name)

- FileContent (takes in the files to upload on Sharepoint)

 

Now my problem here is I keep getting the following error when using that code with a button. 

So the idea here is to upload files and a flow saves them to SharePoint. However, I've been battling with this after a few code refactors. 

 

Siziwe_0-1703230925122.pngSiziwe_1-1703230942803.png

 

Categories:
I have the same question (0)
  • A_Madsen Profile Picture
    67 on at

    Have you added the flow to your app? Try clicking the Power Automate icon, and selecting “Add flow”, and select the flow you’ve created.

     

    A_Madsen_0-1703232027636.png

     

     

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Siziwe ,

     

    Please try this:

     

    FlowName.Run(
     {
     file: {
     name: First(DataCardValueUpload.Attachments).Name,
     contentBytes: First(DataCardValueUpload.Attachments).Value
     }
     },
     First(DataCardValueUpload.Attachments).Name
    )

     

     

    Best regards,

    Rimmon

  • Siziwe Profile Picture
    38 on at

    I have the flow added:

    Siziwe_0-1703232199480.png

     

  • Siziwe Profile Picture
    38 on at

    Hi @v-mengmli-msft 
    I've added the formula and keep getting the error:

    Siziwe_0-1703232401438.png

     

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Siziwe ,

     

    Try clicking the button to check if the flow can run.

  • Siziwe Profile Picture
    38 on at

    It's not running. 

    Tested on automate and the workflow works as it should. However, on powerapps it's not

     

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Siziwe ,

     

    Do you mean that there is still an error on formula and flow can't be triggered by button? Could you please show some screenshots?

    Please let me know if I misunderstand something.

  • Siziwe Profile Picture
    38 on at

    Siziwe_0-1703234319074.png

    As it standards, I have this basic UI that supports a basic submission. The button I'm using is the "send" one. However, if I click it. It's not triggering the flow. 

    If I trigger the flow on power automate then it runs as it should. You asked me to test with the code you supported with and I did (on powerapps) however, it's not triggering the flow. 

    There is still an error in the formula:

    Siziwe_1-1703234532269.png

     

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Siziwe ,

     

    After my testing, I guessed that this might be caused by the order of the values in the formula, trying to adjust the order of the two values in the formula.

    FlowName.Run(
     First(DataCardValueUpload.Attachments).Name,
     {
     file: {
     name: First(DataCardValueUpload.Attachments).Name,
     contentBytes: First(DataCardValueUpload.Attachments).Value
     }
     }
    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard