cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Level 8

Concatenate SharePoint List Attachment Titles

Hi all, 

 

I have a SharePoint list with attachments.

I need to get the names of all attachments and save this data into a "Multiple Lines of text" column in the list. 

I'm close, but I need help with the formula. 

I'm using a "Get attachments" action, then a "set variable" action from the outputs like so:

 

concat(body('Get_attachments')) 
 
This gives me something like this:

[{"Id":"%252fLists%252fContract%2bRegister%252fAttachments%252f98%252f098%2bSupplierX%2bTechnology.pdf","AbsoluteUri":"https://Mydomain.com/Lists/Contract Register/Attachments/98/098 Mexon Technology.pdf","DisplayName":"098 Supplier Technology.pdf","@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListItemAttachment"}]

 

I tried:

concat(body('Get_attachments')?['DisplayName']) but that was invalid because "...property 'DisplayName' cannot be selected. Array elements can only be selected using an integer index."
So basically all I need is the DisplayName of each of the items in the output of Get Attachments. 
Any suggestions?
ThanksFlow1.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Concatenate SharePoint List Attachment Titles

Hi @SylvieLet17 ,

 

Please refer to screenshot below to create the flow to achieve your needs:

Annotation 2019-07-29 160956.png

 

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

2 REPLIES 2
Alex_Bondin
Level: Power Up

Re: Concatenate SharePoint List Attachment Titles

Hi @SylvieLet17 

"Get Attachments" action returns array so I would suggest approach below:

  • Create variable "AttachmentNames" as array, where you store all attachment names
  • Add "Append to array variable" action and select "DisplayName" property from "Get Attachments" action. It adds "Apply to each" action automatically.
  • You can use join(variables('AttachmentNames'),'; ') to convert array into string

AttachmentFlow.png

  • You can use join(variables('AttachmentNames'),'; ') to convert array into string

join.png

Community Support Team
Community Support Team

Re: Concatenate SharePoint List Attachment Titles

Hi @SylvieLet17 ,

 

Please refer to screenshot below to create the flow to achieve your needs:

Annotation 2019-07-29 160956.png

 

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

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,048)