filesharepointpowerappspowerapps-canvassharepointdocumentlibrary

how to update SharePoint library file meta data in Power Apps


I have a Document library named "Project Details" with different files and folders with different columns. I have also added some files inside folders, like the one below. enter image description here

Now, I would like to update the specific file inside the folder using my Power Apps Form. For that, I have used the below code.

Patch(
'Project Details',
First(
    Filter(
        'Project Details',
        gal_Records.Selected.ID
    )
),
{
    'First Name': DataCardValue2.Text,
    'Last Name': DataCardValue3.Text,
    Email: DataCardValue4.Text,
    'Document Type': {Value: DataCardValue10.Selected.Value},
    'Project Details': DataCardValue5.Text,
    'Start Date': DataCardValue6.SelectedDate,
    'End Date': DataCardValue7.SelectedDate,
    ' Is Approved': DataCardValue9.Value
}

)

enter image description here

But, unfortunately, it will update the main folder records. However, my requirement is to update specific file metadata. Could please give any solution


Solution

  • the First and Filter functions are not required here. Try this code:

    Patch(
        'Project Details',
        gal_Records.Selected,
        {...}
    )