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
v-xida-msft
Community Support
Community Support

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

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

21 REPLIES 21
v-xida-msft
Community Support
Community Support

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.
Anonymous
Not applicable

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

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.

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!

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


@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?

bump @v-xida-msft 

Varsha2005in
Helper I
Helper I

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.



 


@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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,758)