cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DemoMan
Level: Powered On

Flow creating multiple items on a list

Good Afternoon All, 


Hope I could find some help here. 

 

I have a simple flow that triggers when a email is received and logs the information for that email to a list. When I receive an email with more than one attachment the flow updates the list with each attachment name as a separate item, is there a way to have the flow put all the attachment names on a single multi line field instead or creating an item for each? 

 

Thank you for the help in advance. This is a great community. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow creating multiple items on a list

Hi @DemoMan,

 

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

Could you please show more details about your SharePoint list?

Further, do you want to put all attachment names into a Multiple lines of text column of your SharePoint list?

 

I have created a SharePoint list on my side and the data structure of it as below:25.JPG

Note: The Subject and Body column are both Single line of text type column, the Received Time column is a Date and Time type column, the From and To column are both Person or Group type column, the AttachmentNames column is a Multiple lines of text type column.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a Variables->"Initialize variable" action, Name set to AttachmentNames, Type set to String and Value set to empty.
  • Add a "Html to text" action, Content field set to Body dynamic content of the trigger.
  • Add a "Apply to each" action, input parameter set to output of the Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Compose" action, Inputs field set to follwoing formula:
concat(item()?['Name'],'</br>',variables('AttachmentNames'))

Add a "Set variable" action, Name choose AttachmentNames, Value set to output of the "Compose" action.

 

  • Under "Apply to each" action, add a "Create item" action, the AttachmentNames field set to AttachmentNames variable.

Image reference:26.JPG

 

27.JPG

The flow works successfully as below:28.JPG

 

29.JPG

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

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
Super User
Super User

Re: Flow creating multiple items on a list

Are you asking if you can have 1 list item that contains all attachments for a given email?

If so, here is a screen shot of a Flow that does just that:

attachment1.jpg

 

If this isn't what you need, please provide some additional detail.

 

Scott

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

Scott
Community Support Team
Community Support Team

Re: Flow creating multiple items on a list

Hi @DemoMan,

 

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

Could you please show more details about your SharePoint list?

Further, do you want to put all attachment names into a Multiple lines of text column of your SharePoint list?

 

I have created a SharePoint list on my side and the data structure of it as below:25.JPG

Note: The Subject and Body column are both Single line of text type column, the Received Time column is a Date and Time type column, the From and To column are both Person or Group type column, the AttachmentNames column is a Multiple lines of text type column.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a Variables->"Initialize variable" action, Name set to AttachmentNames, Type set to String and Value set to empty.
  • Add a "Html to text" action, Content field set to Body dynamic content of the trigger.
  • Add a "Apply to each" action, input parameter set to output of the Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Compose" action, Inputs field set to follwoing formula:
concat(item()?['Name'],'</br>',variables('AttachmentNames'))

Add a "Set variable" action, Name choose AttachmentNames, Value set to output of the "Compose" action.

 

  • Under "Apply to each" action, add a "Create item" action, the AttachmentNames field set to AttachmentNames variable.

Image reference:26.JPG

 

27.JPG

The flow works successfully as below:28.JPG

 

29.JPG

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

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

DemoMan
Level: Powered On

Re: Flow creating multiple items on a list

Thank You Very much! @v-xida-msft This worked great!

apearson
Level: Powered On

Re: Flow creating multiple items on a list

Hi Kris,

 

I am trying to combine a couple of your examples to take a list of sharepoint items and combine them so I can put them into a word template using a thrid party flow. Here are the other examples that I am working off of:

 

I seem to be getting stuck at your concat function. When I try to use this and it flows back into my test list, it apears like this: 

output capture.PNG

Here is a copy of the code I am using: 

concat(item()?['Title'],'</br>',variables('Augmented String'))
 
Here are three pictures of my flow:
Flow 1.jpgPart 1

 

Flow 2.PNGPart 2

 

Flow 3.jpgPart 3

 Any help would be greatly appreciated!

 

Thank you,
Alex

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,029)