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 / Upload file to documen...
Power Apps
Unanswered

Upload file to document library and update metadata based on form submitted to SharePoint list

(0) ShareShare
ReportReport
Posted on by 70

Hi All,

 

I have a Edit form with an upload control. The data connection of the form is established with a SharePoint list ListA. When a file is attached using the form control, it is expected to update in a SharePoint Document Lib DocA.  I have used Graph API to upload the file and the function is written in OnSelect property of Submit button before the SubmitForm() is executed.

Now the challenge is, when the file is uploaded in DocA,  I want few list column values to also get updated along with file uploaded to DocA.


ForAll(
        'Quotation 1'.Attachments,
        Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/sites/<<SiteID>>/drives/<<DocA_ID>>/root:/"& ThisRecord.Name &":/content",

        "PUT",

        ThisRecord.Value

));

ForAll(
        'Quotation 2'.Attachments,
        Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/sites/<<SiteID>>/drives/<<DocA_ID>>/root:/"& ThisRecord.Name &":/content",

        "PUT",

        ThisRecord.Value

));


IfError(
        SubmitForm(Form1),
        Notify(
              "Failed to submit",
              NotificationType.Error
        ),
        Notify(
              "Form has been Submitted",
              NotificationType.Success
        );
ResetForm(Form1);
Navigate(SuccessScreen)
);

How can that be achieved as using the Http request, already the file is uploaded. How can we update the column values for each file?

 

@ShaneYoung @WarrenBelz @Ethan_R @developerAJ 

Categories:
I have the same question (0)
  • Dan7Merc Profile Picture
    96 on at

    Any takers on this Item? I have the issue and still looking for possible solutions

  • Anupama_live Profile Picture
    70 on at

    Hi @Dan7Merc ,

     

    I figured out an alternate solution by calling a automate flow from PowerApp form on onSelect property of Submit button.

    A sample like below:

    I am checking for number of files uploaded in the attachment control, then trigger the automate flow called "UploadAssessmentRepos". Passing all the parameters from PowerApp which is defined in the PowerApp(V2) trigger action in Automate flow.

    If(Value(attCount1.Text)=1, UploadAssessmentRepos.Run(
    {
    contentBytes: First('Quotation 1'.Attachments).Value,
    name: DataCardValue41.Text & "-V1-" & First('Quotation 1'.Attachments).Name
    },
    ddGoodsServices.Selected.Value,
    ddContractType.Selected.Value,
    DataCardValue41.Text,
    DataCardValue80.Text
    ),varNoAttachment);

     

    Using this, I can upload the attachment file along with update column values for each file.

     

    Hope you find this helpful.

  • Dan7Merc Profile Picture
    96 on at

    @Anupama_live thanks for the update...
    I used one of Rezza's magic trick using API request followed by an UpdateIf to update the remaining data and it worked.

  • Anupama_live Profile Picture
    70 on at

    wow. good to know. Could you please share the link?

  • AhmedAksam78 Profile Picture
    7 on at

    Could you please share the link?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    To those of you looking for the link:

     

    Just so you're aware and so you can prepare your solution so that it doesn't affect your app when they turn it off:

    The Office365Groups API call exploit was noted and fixed by Microsoft - this is why they deprecated the V1 action.

    The V2 action only allows calls to the /groups segment, and the V1 action will be fully deprecated (and no longer be available) in the near future


    You can see more here in the Connector reference for Office365Groups

    iAm_ManCat_0-1698394609273.png

     

     

    To call other graph API functions you must now use the 'Invoke an http request' with Azure AD action.

     

    Cheers,

    Sancho

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard