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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (5,429)