cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lliu_western
Resolver II
Resolver II

Is it possible to use Patch Function to patch the attachment files into SharePoint?

Hello Community,

 

I have a form App - I do not use the EditForm function or having the PowerApps to create the Form for me. I built the entire form from scratch, where each individual dropdown box, input box or combo box are connected to SharePoint List/column one by one and the Submit button of the form, I use the "Patch" function. 

 

Is there anyways I can use patch function with the submit button I made to patch all the information along with the attachments into the SharePoint? 

 

Any advice is appreciated, thank you in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions

@v-qiaqi-msftthis worked perfectly.

I called Form.Updates without passing any parameters into patch on a New Form, the entry was created and the attachments were uploaded to the SharePoint list. Thanks a ton.

Here is my sample code.

                Patch(
                    Workflows,
                    Defaults(Workflows),
                    {},
                    //Required to add attachments
                    StartNewForm.Updates;
                )

 

View solution in original post

10 REPLIES 10
RezaDorrani
Dual Super User II
Dual Super User II

Hi @lliu_western 

 

Patch does not support attachments.

Here is a video of all SP column types and Patch - https://www.youtube.com/watch?v=g9ChYuTdNd4

 

To add attachments I have a couple of vlogs around this

https://youtu.be/5XsWgVnR7SU

https://youtu.be/UYK7yruBHDM

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

v-qiaqi-msft
Community Support
Community Support

Hi@lliu_western,

Based on the issue that you mentioned, do you want to patch attachments to SharePoint list?

Could you please share more about your scenario and your form configuration? Please provide screenshots about a form you created from scratch which doesn’t use EditForm() or Form control within PowerApps.

As we know, we can patch attachments to the SP list through Attachment control within Edit Form from PowerApps while we can’t achieve this you want to patch it directly.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

Since you create your form from scratch, you can consider adding the Attachment field from the SP list data source.005.png

Set the OnSelect property of the Button as below:

Patch(
    ‘SPlist’,
    Defaults('SPlist'),
{Title: TextInput1.Text
…},
    EditForm1.Updates
)

Best Regards,

Qi

 

Best Regards,
Qi
v-qiaqi-msft
Community Support
Community Support

Hi@lliu_western,

Have you solved your issue?

If it solves your request, Mark it as a Solution to enable other users to find it.

Best Regards,

Qi

Best Regards,
Qi

@v-qiaqi-msftthis worked perfectly.

I called Form.Updates without passing any parameters into patch on a New Form, the entry was created and the attachments were uploaded to the SharePoint list. Thanks a ton.

Here is my sample code.

                Patch(
                    Workflows,
                    Defaults(Workflows),
                    {},
                    //Required to add attachments
                    StartNewForm.Updates;
                )

 

Hi@lliu_western,

Glad I could help.

If it solves your request, Mark it as a Solution to enable other users to find it.

Best Regards,

Qi

Best Regards,
Qi

Great tip @v-qiaqi-msft 

Suchithra_A
Helper I
Helper I

Hi, 

 

Can Anyone please explain how to remove attachment from the sharepoint list in powerapps.

 

I tried below patch function, Which is only attaching newly added file but it is not removing the file from powerapps.

 

Thanks,

Rodolfo1840
Advocate III
Advocate III

Have you tried with Microsoft Graph?

Mgreenwald
Frequent Visitor

very helpful!!! Searched for a long time to find a way to add in data from different data sources to a single sharepoint list along with an attachment... This was the by far the easiest way to do both in a single submission button. Thank you!

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.

Users online (1,648)