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

8 REPLIES 8
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?

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,661)