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 / Adding properties to a...
Power Automate
Suggested Answer

Adding properties to a file in Sharepoint

(0) ShareShare
ReportReport
Posted on by 14
Hi
 
I have created a canvas app in Power Apps based on Dataverse tables.
In the app it is possible to upload a file from the desktop to Sharepoint using Power Automate.
However - now I would like to add some properties to the file saved in Sharepoint (a reference to find the files relatede to a certain group).
 
On a "upload"-button in Power Apps I have this code in "onselect":
-------------
ForAll(
    DataCardValue226.Attachments;
    Upload_Produkt_Bilag.Run(
        {
            file: {
                contentBytes: ThisRecord.Value;
                name: ThisRecord.Name
            }
        }
    )
)
-------------
 
What should I do to paste eg. the value from gallery1.selected.productnumber in the column with the red circle?
I have tried several solutions, but none of them works for me... (it still loads the file to Sharepoint, but the "productnumber is not loaded to the column)
 
wkr Jørgen
Categories:
I have the same question (0)
  • Suggested answer
    Infamous_Let Profile Picture
    330 on at
    In Power Automate, open your flow (Upload_Produkt_Bilag) and in the Power Apps trigger, add a new Text input—call it something like ProductNumber. Then, after your "Create file" step, add an "Update file properties" action. Use the ID of the created file, and in the properties, map your custom SharePoint column to the ProductNumber input.
     
    Back in Power Apps, just tweak your formula like this:
     
    ForAll(
        DataCardValue226.Attachments,
        Upload_Produkt_Bilag.Run(
            {
                file: {
                    contentBytes: ThisRecord.Value,
                    name: ThisRecord.Name
                }
            },
            Gallery1.Selected.ProductNumber
        )
    )
    

    This way, Power Apps sends the product number along with the file, and Power Automate updates the metadata in SharePoint.
  • Suggested answer
    Riyaz_riz11 Profile Picture
    3,893 Super User 2025 Season 2 on at

    In Power Automate—Edit your flow

    Open your flow (Upload_Produkt_Bilag).

    Step A: Receive file and metadata

    Right now you are only passing:

    {
    file: {
    contentBytes: ...,
    name: ...
    }
    }
     

    You also want to pass the ProduktNummer.

    Add an extra input parameter in your flow:

    • ProduktNummer (Text)

    Step B: Create File

    Keep your Create File action as you have it:

    • Folder Path: where you save the file

    • File Name: name

    • File Content: contentBytes

     After this action, you get an Identifier or ItemId output.

    Step C: Update File Properties

    Add a new action:

    SharePoint – Update file properties

    • Site Address: same site

    • Library Name: same library

    • Id:

      • Use Identifier from Create File (dynamic content)

    • ProduktNummer:

      • Use the ProduktNummer input parameter you just added

    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz

  • CU14081108-3 Profile Picture
    14 on at
     
    I have now added this parameter to my flow:
     
    I have added this action (update file properties):
    In the app I have added this yellow part to the onselect...
     
    As you can see there is something wrong... But what is it...? (it works fine, when testing the flow in Power Automate, so it must be something with in the command...
     
    Wkr Jørgen

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard