Workflow to count the number of items in a list

Hello Friends,

I've a requirement, I need to count the number documents uploaded for a particular list item (identified by a unique Title) and if the count matches with the count stored in another list for that particular list item, bingo......I will update the status field to completed.

Can anybody please help me with this. How do I do this ? Is it possible even ?

Thank you very much in advance. :)

February 5th, 2015 4:34am

Hi,

I haven't tried this but i think you can achieve it by

1. Add an Call HTTP activity in your workflow and make a REST call get items

2. Use Count Items in (Dictionary variable)to get the Items counts of attachment.

3. Then, lookup for your another list in match item count.

Your REST query can be similar to this

url: http://site url/_api/web/lists/getbytitle('list title')/items(item id)/AttachmentFiles/

To make Rest call in SharePoint designer

https://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/

https://msdn.microsoft.com/en-us/library/office/dn567558%28v=office.15%29.aspx

  • Marked as answer by Prajk11 Thursday, February 05, 2015 12:30 PM
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 5:23am

Hi,

One way to get the attachments count is to write the custom activity and use the custom activity in your workflow.

Alternate option is to use the event receiver.

The option suggested by Alok works only with SharePoint 2013.

Please don't forget to mark it as answered, if your problem resolved or helpful.

  • Marked as answer by Prajk11 Thursday, February 05, 2015 12:30 PM
February 5th, 2015 5:34am

Hello,
I agree with Mokhtar.

I suggest you to create one event receiver and associate it to your list. I think this is the easiest way to achieve it.

Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 8:55am

Hello Friends,

thanks for your advice. If I want to achieve it only Out of the box, then what would be the best approach. Can anybody please suggest.

Thanks again !

February 5th, 2015 12:30pm

Hi Prajk11,

                 You can't achieve it through out of the box feature.You can use event reciever to achieve it easily.

Thanks
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 12:47pm

Hi TechChaitu,

Even in SharePoint 2013 ?

Thanks.

February 5th, 2015 2:36pm

Hi,

In SharePoint 2013, you can use the SharePoint 2013 type workflow and then use the method as suggested by Alok Krishna.

Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 2:43pm

Thanks for this suggestion!  I was able to use your outline to have a workflow get the number of items in a list, so I can email a warning if the list is getting very large.  SharePoint 2013 workflow has a lot of new useful features.
April 2nd, 2015 3:50pm

Hi,

How about using Powershell Script to achieve the requirement.

You can use Task Scheduler to run at desired frequency and you can automate the Warning email to desired recipients.

Post your response if you have any queries.

Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2015 4:35pm

In SharePoint 2013 using SharePoint Designer, you can do it.  Follow the suggestions from Alok given above.  I was able to use that to get it to work.
April 2nd, 2015 4:38pm

Yes, that's correct. The answer suggested by Alok works in SP designer 2013.
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2015 2:37am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics