cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Perez
Helper V
Helper V

save attachment to a sharepoint list

Hi,

i copied an attachment componnet from a form to my app screen, i.e. the attachment is not part of an edit form.

how can i save it into the sharepoint list?

i tried the below, but its not working:

Patch('Brief Process',
 Defaults('Brief Process'),({
..
..
 Attachments:AttachmentField.Attachments})

thanks,

Eyal

3 REPLIES 3
Ethan_R
Super User
Super User

Hi @Perez ,

I would like to suggest you this YT Video from Shane.

I've used it and it simply works perfectly.

 

Hope this helps.

Hi @Ethan_R ,

thanks for your reply.

i tried the method explained in Shane's video, but didn’t succeeded.

in the video it is saved into a document library while I’m trying to save into a SharePoint list.

i made the following necessary changes:

  1. i used the add attachment activity rather than create file
  2. after the patch activity into the list i added this formula:

 

EasyUpload.Run(Last(AttachmentField.Attachments).Name,"" ,"",varBase64Only,Last(Sort('Amdocs Agency - Brief Process',ID,Ascending)).ID);

 

 

i couldn’t add it a s part of the patch as i need to get the ID of the created item.

any idea?

 

 

Ramole
Super User
Super User

Hi @Perez 

 

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  in PowerApps currently.

 

You can do it via Attachments field within the Edit form. Use a formula like below:

 

 

 

Patch('Brief Process',
 Defaults('Brief Process'),({
..
..
 },YourEditFormName.Updates)

 

 

 

If this post helps, then please consider Accept it as the solution to help the others

 

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,601)