Hello!
I am just getting crazy and I don't know how to get this solved:
I have a Form in my app connected to a Library in Sharepoint. I found a really helpful tutorial on how to submit files to a Library directly from a PowerApps (Power Apps Easiest Way To Upload Files To A SharePoint Document Library (matthewdevaney.com))
So, my aim is to manage to edit the properties of that submitted file with the form in my app. If I edit the properties manually in my Sharepoint Library, they are correctly displayed in my form, but if I try to edit and save the data, there's no change. All items appear blank in my Library.
This is the formula I am using for the submit button (and it doesn't give me an error when submitting the information):
Set(
BudgetDocId,
AddBudgettoLibrary.Run(
{
contentBytes: First(DataCardValue99_1.Attachments).Value,
name: First(DataCardValue99_1.Attachments).Name
}
).docid
);
Patch(
'Budget & Procurement',
LookUp(
'Budget & Procurement',
ID = BudgetDocId
),
{
'PT item': DataCardValue24.Selected,
Title: DataCardValue160.Text,
'Doc Type': DataCardValue161.Selected,
'Doc Group': DataCardValue162.Selected,
'Linked IoN ID2': DataCardValue163.Selected,
'SAP Reference': DataCardValue164.Text,
'Invoice No': DataCardValue165.Text,
'Invoiced Net Amount': Int(DataCardValue166.Text),
Source: DataCardValue21.Selected,
Taxonomy: DataCardValue25.Selected
}
);
Notify(
"Your file has been submitted!",
NotificationType.Success
);
To clarify, in case it is needed, the "BudgetDocId" is a variable obtained in the Flow that returns me the ID of the submitted file.
Then, first function is to submit the file via a Flow to the Library.
The second function, the Patch (where I feel is the issue), is to edit the Library record properties (it is working in other Forms in the app, but those are linked to Lists, not Libraries)
The third function is just to notify if the file was submitted properly
Could someone tell me how to fix this, please?
Hello @EddieE
Thank you very much for your reply and sorry for the delay in replying. The method in the video worked for me! I just had to adjust it to my form, but it was fine
I am accepting it as solution
Just guessing here but it's possible that the variable BudgetDocId isn't getting created before the Patch() code runs - which is possibly why the metadata isn't getting added.
Some things you could try:
- add the action 'Respond to PowerApps or Flow' as the last action in your flow. This can sometimes work when there's a delay like this.
- move your Patch() to your Flow instead and use the 'Update file properties' action. Chino Does stuff explains what you can do in this video
https://www.youtube.com/watch?v=yC0W5am6M3Q&t=1182s
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional