cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AOZ
Helper III
Helper III

Adding Attachment to a PATCH to a SharePoint List

Hi all,

I have built an entire form from scratch, where each individual dropdown box, input box or combo box are connected to SharePoint List/column one by one. I then store everything in a collection because users do not have internet connection everytime. When users go online, i use the "Patch" function to upload the data. My problem is the attachment contents.

The pictures are stored in a collection (ColImages).
The attachment datacard is hidden in my edit form - and it's update property is the ColImages.
So basically, if i submit the form (when online), all columns are perfectly updated as well as the attachments.

Is there a way I can use patch function to patch all the information along with the attachments into the SharePoint?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @AOZ ,

There is only one way Patch will upload attachments - from a Form using FormName.Updates. This will not work in your case and you will need to use Power Automate (this blog of mine may assist) to upload them form the collection.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @AOZ ,

There is only one way Patch will upload attachments - from a Form using FormName.Updates. This will not work in your case and you will need to use Power Automate (this blog of mine may assist) to upload them form the collection.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @WarrenBelz 

Thanks for your answer.

I have used below to store the pictures in a collection (i have multiple screens with different picture naming).

Collect(
    ColImages,
    {
        DisplayName: "CloseUpShot1" & ".jpg",
        Id: "CloseUpShot1" & ".jpg",
        Value: Camera1.Photo
    }
    );
Collect(
    ColImages,
    {
        DisplayName: "ComponentsOrParts" & ".jpg",
        Id: "ComponentsOrParts" & ".jpg",
        Value: Camera1_5.Photo
    }
    );
    

AOZ_0-1632148775047.png

I am struggling to get these pictures in a library first, then update the list item attachment field. Followed your blog but something is missing somewhere...

 

 

@AOZ ,

The blog only covers single images - so you can do a ForAll() on the collection with the Flow in it. 

Multiple images are possible but far more complex and involve JSON code formatting into an array variable in Power Automate (not something I am the person to guide you on).

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,985)