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 / First App (Power Apps ...
Power Apps
Answered

First App (Power Apps / Sharepoint) - Question

(0) ShareShare
ReportReport
Posted on by 17

I'm beginning with Power Apps / Power Automate and I have a question with my first APP.

I want to create a simple APP where I upload a file in an attachment control then I click on a button ant it uploads the file on a sharepoint site.

- I created a sharepoint site called Site Test

- then an APP with a attachment control called "AttachmentControl"

 

Titus77_0-1701118750974.png

 

- the property "OnSelect" of my button has value:

Titus77_1-1701118848710.png

And finally a power automate flow called "SaveImageToSharePoint"

Titus77_3-1701119019935.png

It works but the file that I upload is saved with name "test.pdf" on the sharepoint site.
How can I change the flow in order to keep the original name of the file I'm uploading and not "test.pdf"?

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    Hi @Titus77 ,

    The file name can be as below (assuming you are sending the attachment Table to the Flow)

    WarrenBelz_0-1701121688161.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Titus77 Profile Picture
    17 on at

    Thanks @WarrenBelz 

     

    But it saves my file with name file.name
    Titus77_0-1701121967390.png

    How can I send the attachment Table to the Flow ?

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Titus77 ,

    How are you sending it now (code in Text please)

  • Titus77 Profile Picture
    17 on at

    that's how I send it :

     

    OnSelect Property of the button:

    SaveImageToSharePoint.Run({
    file:{
    contentBytes:First(AttachmentControl.Attachments).Value;
    name:First(AttachmentControl.Attachments).Name
    }
    }
    )
    ;;Reset(AttachmentControl)

     

     

    SaveImageToSharePoint is the name of my flow

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Titus77 ,

    I assume you made the code an expression ? The Table code is how I do mine (and that is a Prod Flow I posted) and it works as expected.

  • Titus77 Profile Picture
    17 on at

    @WarrenBelz Thanks but I don't understand what you mean : I assume you made the code an expression  ?

     

    The code above is the value of the OnSelect Property of my "Upload file" button.
    I'm just looking which value to put in "Nom de fichier" field.

    I tried to put  value "file.name"but it does not work. So something is missing but I don"t know what.

    Titus77_1-1701126933009.png

     

     

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Titus77 ,

    The code in the picture I sent needs to be an Expression (second tab in the right box) and should look like mine when saved.

  • Titus77 Profile Picture
    17 on at

    @WarrenBelz Here is the code (second tab):

     

    {
        "inputs": {
            "host": {
                "connectionName""shared_sharepointonline",
                "operationId""CreateFile",
                "apiId""/providers/Microsoft.PowerApps/apis/shared_sharepointonline"
            },
            "parameters": {
                "dataset""https://trc2d.sharepoint.com/sites/SiteTest",
                "folderPath""/TestLib",
                "name""file.name",
                "body""@triggerBody()['file']['contentBytes']"
            },
            "authentication""@parameters('$authentication')"
        },
        "runtimeConfiguration": {
            "contentTransfer": {
                "transferMode""Chunked"
            }
        },
        "metadata": {
            "operationMetadataId""e7c92881-d24d-4c0d-9792-489a667620d0"
        }
    }
     
    other second tab (I don't know which oneyou speak):

    Titus77_1-1701166668878.png

     

  • Verified answer
    WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Titus77 ,

    The issue is in the Flow, not in Power Apps - the name simply needs to be an Expression as I posted

    FlowExpression.jpg

  • Titus77 Profile Picture
    17 on at

    @WarrenBelz ok thanks for the solution, I did not find which expression to use.

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 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard