cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
aak1
Nintex Newbie

Count number of attachments

Jump to solution

Hi, I need to count the number of attachments a list item has. I just need to be able to send an email with the attachments as well as the number of attachments in the body of the email. I've seen some similar questions here, but nothing matching exactly. Any help would be great.

 

Thanks.

Labels: (1)
0 Kudos
Reply
2 Replies
Nintex Employee
Nintex Employee

Re: Count number of attachments

Jump to solution

@aak1  - 

 

You can get the attachments by using the REST endpoint:

yourtenant.sharepoint.com/sites/yourSite/_api/web/lists('listID')/Items(itemID)/AttachmentFiles

 

From here you can get your response data will be stored in a dictionary. You will want to pull out the individual attachment results and put them in another dictionary or a collection. Lastly, simply use the Count Items in a Dictionary or Count Items in Collection (depending on where you store the results).

 

Here is what it would look like:GetAttachment.PNG

 

 

And here is each step:

Build Dictionary.PNGBuild A Dictionary

 

 

HTTP Web Service.PNGHTTP Web Request

 

 

Get Item From Dictionary.PNGGet Items From A Dictionary

If you are using the Count Items In Collection action, be sure your content variable is a Collection. If you make it a dictionary, you will need to use the Count Items in a Dictionary instead.

 

 

Count Items in Collection.PNGCount Items In Collection

Hope this helps!

 

0 Kudos
Reply
aak1
Nintex Newbie

Re: Count number of attachments

Jump to solution

This worked perfectly. Thank you so much for such a detailed solution.

0 Kudos
Reply