cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
addy2019
Advocate V
Advocate V

Is it not possible to attach files in Sharepointlist using Patch?

I have read some articles which says its not possible to attach files to sharepointlist using Patch. Is it true? If this feature is missing its a huge drawback, when all different kinds of fields can be patched why not attachments?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @addy2019 :

In theory, using form control and submitform function is the only way to add attachments to existing records in a canvas app.

If you insist on using Patch function------as an alternative solution, you could consider take a try to only add the Attachments field within the Edit form. I have made a test on my side, please take a try with the following workaround:

1.JPG2.JPG

Set the OnSelect property of the "Submit" button to following formula:

Patch(
'20180921_case2', /* <-- My SP List */
Defaults('20180921_case2'),
{Title:"PowerApps3",TaskName:"Task3",NoOpportunity:true,NoOpp_PostSales_x0020_:true},
EditForm1.Updates
)

Note: The Editform1 represents the Edit form control within your app, which only display the Attachments field. 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-to-add-Attachment-to-a-PATCH-to-a-Share...

https://powerusers.microsoft.com/t5/Building-Power-Apps/Saving-attachments-using-Patch/td-p/277984

Best Rergards,

Bof

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @addy2019 ,

No - it is not unfortunately.

You can however possibly do it with Power Automate, but is far more complex and depends on what you are trying to attach and where you are getting it from.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-bofeng-msft
Community Support
Community Support

Hi @addy2019 :

In theory, using form control and submitform function is the only way to add attachments to existing records in a canvas app.

If you insist on using Patch function------as an alternative solution, you could consider take a try to only add the Attachments field within the Edit form. I have made a test on my side, please take a try with the following workaround:

1.JPG2.JPG

Set the OnSelect property of the "Submit" button to following formula:

Patch(
'20180921_case2', /* <-- My SP List */
Defaults('20180921_case2'),
{Title:"PowerApps3",TaskName:"Task3",NoOpportunity:true,NoOpp_PostSales_x0020_:true},
EditForm1.Updates
)

Note: The Editform1 represents the Edit form control within your app, which only display the Attachments field. 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-to-add-Attachment-to-a-PATCH-to-a-Share...

https://powerusers.microsoft.com/t5/Building-Power-Apps/Saving-attachments-using-Patch/td-p/277984

Best Rergards,

Bof

addy2019
Advocate V
Advocate V

EditForm1.Updates represents whole form & there could be other fields as well. That would be a workaround. For now I'm going with SubmitForm() workaround (with only attachment as one field present in the form).  Not sure if there's already any progress in this function by Microsoft but I'm submitting an idea anyway for it please vote if you feel we should be able to Patch the attachment fields.

 

Patch Attachment fields not possible - Power Platform Community (microsoft.com)

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,547)