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

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 III
Super User III

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

View solution in original post

addy2019
Advocate IV
Advocate IV

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (29,311)