cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Need to add Attachment to a PATCH to a SharePoint List

I have created an app where I want to patch an attachment field to a SharePoint List, but the attachments field is not listed as a field in my SharePoint list per powerapps notification. I know I can attach files using the edit form feature, but all of the other fields in my app are not within a form. Help! 🙂

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Need to add Attachment to a PATCH to a SharePoint List

Hi @Anonymous,

Could you please share a bit more about your scenario?

Do you want to add a attachment to a SP list item using Patch function?

 

If you want to add a attachment to a SP list item using Patch function directly, I afraid that there is no way to achieve your needs in PowerApps currently.

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

 

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:3.JPG

 4.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
)

On your side, you should type following formula:

Patch(
'YourSPList',
Defaults('YourSPList'),
{
Column1:TextInput1.Text,
Column2:TextInput2.Text,
Column3:TextInput3.Text,
...,
ColumnN:TextInputN.Text
},
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/General-Discussion/Patch-Attachments/td-p/98121

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Super User
Super User

Re: Need to add Attachment to a PATCH to a SharePoint List

Here's how I got accomplished this after I could not get @v-xida-msft 's method to work.

Scenario:

  • Two forms, one on each of two screens
  • MainForm: All the DataCards except Attachments
  • ImageForm: Single DataCard, only the Attachments DataCard
  • User fills in the MainForm, at any time they can click a Camera Icon which navigates them to the CameraScreen. They can Take/Upload photos using the ImageForm
  • When complete, the Submit button lights up
  • OnSelect of the Submit button:
    • Patch(SharepointList,
        LookUp(SharepointList, eventId = varEventId),
          frmMainForm.Updates,
          frmAttachments.Updates
      )

Hope this helps!

View solution in original post

12 REPLIES 12
Highlighted
Community Support Team
Community Support Team

Re: Need to add Attachment to a PATCH to a SharePoint List

Hi @Anonymous,

Could you please share a bit more about your scenario?

Do you want to add a attachment to a SP list item using Patch function?

 

If you want to add a attachment to a SP list item using Patch function directly, I afraid that there is no way to achieve your needs in PowerApps currently.

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

 

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:3.JPG

 4.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
)

On your side, you should type following formula:

Patch(
'YourSPList',
Defaults('YourSPList'),
{
Column1:TextInput1.Text,
Column2:TextInput2.Text,
Column3:TextInput3.Text,
...,
ColumnN:TextInputN.Text
},
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/General-Discussion/Patch-Attachments/td-p/98121

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Re: Need to add Attachment to a PATCH to a SharePoint List

@v-xida-msft This worked like a charm!!!! Thank you very much!!! Just exactly what I needed!

Community Support Team
Community Support Team

Re: Need to add Attachment to a PATCH to a SharePoint List

Hi @Anonymous,

Have you solved your problem?

 

If you have solved your problem, please click "Accept as Solution" on the reply that contains the solution so that this thread will be marked for other users to easily identify.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Need to add Attachment to a PATCH to a SharePoint List

Hi @v-xida-msft ,

Has this functionality changed since you posted this solution? I cannot get a single DataCard-Form to Patch into an existing SP record. 

Example:

Single DataCard Form with Attachments:

image.png

Form: Data Source

MY_SP_LIST

DataCard: Update

attachmentControl.Attachments

Save Button: OnSelect 

Patch(
    LookUp(MY_SP_LIST, eventGUID = varEventGUID),
    {
        Attachments: attachmentControl.Attachments
    }
);
ViewForm(frmEdit)

Results: The form switches to ViewMode and thats it, no Patch back to DataSource. 
Any ideas?

Thank you!

Super User
Super User

Re: Need to add Attachment to a PATCH to a SharePoint List

Anyone? I cannot get PowerApps to Patch attachments INTO an existing record. 

PytByt
Level 8

Re: Need to add Attachment to a PATCH to a SharePoint List


@ericonline wrote:

Hi @v-xida-msft ,

Has this functionality changed since you posted this solution? I cannot get a single DataCard-Form to Patch into an existing SP record. 

Example:

Single DataCard Form with Attachments:

image.png

Form: Data Source

MY_SP_LIST

DataCard: Update

attachmentControl.Attachments

Save Button: OnSelect 

Patch(
    LookUp(MY_SP_LIST, eventGUID = varEventGUID),
    {
        Attachments: attachmentControl.Attachments
    }
);
ViewForm(frmEdit)

Results: The form switches to ViewMode and thats it, no Patch back to DataSource. 
Any ideas?

Thank you!


i have the same problem here... 

 

is there no help anymore about this topic?

Super User
Super User

Re: Need to add Attachment to a PATCH to a SharePoint List

bump @v-xida-msft 

Varsha2005in
Level: Powered On

Re: Need to add Attachment to a PATCH to a SharePoint List

Has anyone got a solution for this. I am trying to attach a image from my powerapps to Sharepoint List. I can add image but it is not saving to the Sharepoint List. Is there are any work around.



 

PytByt
Level 8

Re: Need to add Attachment to a PATCH to a SharePoint List


@Varsha2005in wrote:

Has anyone got a solution for this. I am trying to attach a image from my powerapps to Sharepoint List. I can add image but it is not saving to the Sharepoint List. Is there are any work around.



 


I have it too... 😞 

 

We need this.

 

Cheers,

pytbyt

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,486)