Hi Community,
I am trying to patch an attachment back to SharePoint list. The attachment would be patched back together with other details as a new record.
I have read up similar threads on this topic on the forum. Based on them, I created Attachments is as a separate form (Form 3). The rest of the fields are Form2_1.
In the Submit button, I have tried the following
Patch(Details, {'Header ID':HeaderID1, Title:DataCardValue37_1.Text,'Expense Amount':Value(DataCardValue44_1.Text),'Expense Date': DataCardValue45_1.SelectedDate});
Patch(Details,Defaults(Details), Form3.Updates);
UpdateContext({clearform:false});
UpdateContext({clearform:true});
and
Patch(Details, {'Header ID':HeaderID1, Title:DataCardValue37_1.Text,'Expense Amount':Value(DataCardValue44_1.Text),'Expense Date': DataCardValue45_1.SelectedDate});
Patch(Details,LookUp(Details,'Header ID'=HeaderID1), Form3.Updates);
UpdateContext({clearform:false});
UpdateContext({clearform:true});
However no attachments are patched back. There are also no error messages.
I also tried the below and it gives a message "Title: Field Required".
Patch(Details, {'Header ID':HeaderID1, Title:DataCardValue37_1.Text,'Expense Amount':Value(DataCardValue44_1.Text),'Expense Date': DataCardValue45_1.SelectedDate},Form3.Updates);
UpdateContext({clearform:false});
UpdateContext({clearform:true});
Please advise. Thanks.
Solved! Go to Solution.
If you are happy using a Form and there's only one SP List to be updated then there's no need to use 2 Forms, one will do.
Add an EditForm to your app, select the SP List as your data source, Edit Fields and add in Attachments (if it's not shown), setout your form how you want it then you are done. To create a new item it's then just one line of code:
SubmitForm(yourFormName)
Seems you are making this more complex than it needs to be or have I missed something?
If you are happy using a Form and there's only one SP List to be updated then there's no need to use 2 Forms, one will do.
Add an EditForm to your app, select the SP List as your data source, Edit Fields and add in Attachments (if it's not shown), setout your form how you want it then you are done. To create a new item it's then just one line of code:
SubmitForm(yourFormName)
Seems you are making this more complex than it needs to be or have I missed something?
Thank you so much! That works 🙂
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
196 | |
175 | |
62 | |
34 | |
32 |
User | Count |
---|---|
341 | |
271 | |
110 | |
76 | |
59 |