cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

SharePoint List - Add Attachment - unexpected 404

This flow creates an item in List B when an item is created or modified in Library A.

 

Everything is working except that I'm trying to use "Get file content" from Library A and then pass it to "Add attachment" for the newly created item in List B.

 

I am getting a 404 error during Add Attachment (to List B). This is unexpected because because the List item ID is correct. It's handed over from the "create item" action in an earlier step. Here's the error message:

 

image.png

 

In this example, I go to my site, look in the "Hardware Assets" list and see that the Flow created an item with ID 4684, but then failed to find that item during the "Add attachment" step.

 

I think I might be missing something simple. Help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: SharePoint List - Add Attachment - unexpected 404

Hi @JStenitzer,

 

Could you please share a screenshot of your flow's configuration?

 

I have made a test on my side and don't have the issue that you mentioned. My flow's configuration as below:

  • Add a "When a file is created or modified (properties only)" trigger.
  • Add a "Get file metadata" action, File Identifier field set to Identifier dynamic content of the trigger.
  • Add a "Get file content" action, File Identifier field set to Identifier dynamic content of the trigger.
  • Add a "Create item" action, specify Site Address and List Name.
  • Add a "Add attachment" action, specify Site Address and List Name, Id field set to ID dynamic content of "Create item" action, File Name field set to DisplayName dynamic content of "Get file metadata" action, File Content field set to File Content of "Get file content" action.

Image reference:21.JPG

The flow works successfully as below:22.JPG

 

Please check if you have specified proper List Name within your "Add attachment" action. In addition, please check if you have chosen proper ID dynamic content of your "Create item" action within the Id field of "Add attachment" action.

 

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

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: SharePoint List - Add Attachment - unexpected 404

Hi @JStenitzer,

 

Could you please share a screenshot of your flow's configuration?

 

I have made a test on my side and don't have the issue that you mentioned. My flow's configuration as below:

  • Add a "When a file is created or modified (properties only)" trigger.
  • Add a "Get file metadata" action, File Identifier field set to Identifier dynamic content of the trigger.
  • Add a "Get file content" action, File Identifier field set to Identifier dynamic content of the trigger.
  • Add a "Create item" action, specify Site Address and List Name.
  • Add a "Add attachment" action, specify Site Address and List Name, Id field set to ID dynamic content of "Create item" action, File Name field set to DisplayName dynamic content of "Get file metadata" action, File Content field set to File Content of "Get file content" action.

Image reference:21.JPG

The flow works successfully as below:22.JPG

 

Please check if you have specified proper List Name within your "Add attachment" action. In addition, please check if you have chosen proper ID dynamic content of your "Create item" action within the Id field of "Add attachment" action.

 

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

Frequent Visitor

Re: SharePoint List - Add Attachment - unexpected 404

Hi @v-xida-msft,

 

That fixed it!


I did not have a "get file metadata" action. I didn't assume I would need to get the metadata if I was only copying the content.


I was thrown off by the 404 error on the newly created list item. But now that I added the geta file metadata action, it works as expected.


Thank you!

Highlighted
Advocate III
Advocate III

Re: SharePoint List - Add Attachment - unexpected 404

Hi, 

 

For the Add Attachment step, what is the file format that is being expected here?

 

I have a Flow button with a File input.  I would like to attach it to a SharePoint list. 

 

 

I can start a separate thread if that would be more appropriate.

 

Much Thanks,

Sean

Highlighted
Advocate III
Advocate III

Re: SharePoint List - Add Attachment - unexpected 404

I ended up getting this to work:

 

I was able to attach an image that was captured by a Flow button to a SharePoint Item by using this value in the File Content property of the SharePoint - Add Attachment action.

 

base64ToBinary(triggerBody()?['file']?['contentBytes'])

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (4,883)