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

Create multiple SharePoint list items with only one attachment from an email with multiple attachments

I am trying to create a Power Automate flow that is triggered from an email that is received in an Accounts Payable shared mailbox.  The email is from a vendor that may or may not contain multiple invoices.  With that information, the flow is creating a SharePoint list item(s) that attaches the invoices and then sends it out for approval.  The process works great with one invoice. When there are multiple invoices though, they are both getting combined into the same SharePoint list item.  I would like a new SharePoint list item per invoice.  I did use the apply to each step, and multiple SharePoint list items are getting created successfully.   However, each SharePoint item still includes all invoices.

 

Any ideas to attach only 1 attachment to 1 SharePoint list item?

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
StretchFredrik
Super User
Super User

Hello, 

Right now you are looping attachments and adding them to ONE item in ur flow.

 

Instead of ur step of "Add attachment" in the loop use the "Create new Object" And then in the same loop use the "add attachment" after. Then use the ID from the current loop.

 

That way we will create 1 object per attachment and add one attachment per loop. Hopefully this helps you abit in your thought process on how to solve this 🙂  

View solution in original post

You will need to change the actions in the loop to the following, same as mentioned by@StretchFredrik :

Snag_241ae2b.png


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

LMT
Frequent Visitor

Thanks for both of your explanations.  It did the trick!

View solution in original post

5 REPLIES 5
ekarim2020
Super User
Super User

See: How to save email attachments to a SharePoint Document Library using Power Automate

Replace step (4) Create File action with your Create SharePoint List Item action(s).

 

ekarim2020_3-1645660825538.png

 

 

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

LMT
Frequent Visitor

Thanks for your response.  That is what I am doing but both attachments are getting attached to one item versus two.

 

LMT_0-1645707607119.png

LMT_2-1645707771548.png

 

 

StretchFredrik
Super User
Super User

Hello, 

Right now you are looping attachments and adding them to ONE item in ur flow.

 

Instead of ur step of "Add attachment" in the loop use the "Create new Object" And then in the same loop use the "add attachment" after. Then use the ID from the current loop.

 

That way we will create 1 object per attachment and add one attachment per loop. Hopefully this helps you abit in your thought process on how to solve this 🙂  

You will need to change the actions in the loop to the following, same as mentioned by@StretchFredrik :

Snag_241ae2b.png


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

LMT
Frequent Visitor

Thanks for both of your explanations.  It did the trick!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT 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.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,324)