1

I have a task list / calendar that serves as a signup for classes. What I am trying to do is set 20 people per class per date. Once 20 people have signed up for the class (i.e. - once we have 20 list items with the same date), the date is no longer available for folks to sign up for.

I'm trying to use a workflow for this, but can't figure out how to make this happen.
Any ideas?

One more thing - this one list will contain multiple dates, but there can only be 20 people that sign up for each date.


UPDATE - EDIT - Screenshots Below are screenshots of the workflow (in Nintex)

enter image description here

enter image description here

enter image description here

2
  • A rest query with date filter, and if the results length is greater than 20, delete that new item. You can try with power-automate too – Ashik Paul Jul 8 '20 at 19:06
  • We're using SP 2013 - Can't use Flow/Power Automate. So, how would I go about setting the query? I've never used one in SP before. – DanJ Jul 8 '20 at 20:20
1

Check this post for a similar discussion: How can I limit the number of items that can be entered into a list?

If you want to use workflow to restrict events created on one day, you can detect the number of items existing and automatically delete new items when the number exceed 20.

It might require additional customization on the list and the workflow.

Another post for your reference: Limit only one entry per day per user in sharepoint list.

3
  • I'm not trying to restrict entries per day. The entire list will have multiple class dates listed. I'm trying to limit the number of list items that contain any one particular date. On a related note, COUNT isn't an option in calculated columns - -how do you come up with that? I've edited my original question for clarity on this issue. Hope this helps. – DanJ Jul 10 '20 at 17:38
  • @DanJ Sorry I’m not quite following, but I did not propose a solution with Calculated column. The references I provide is meant for ideas that might be useful to you. If you are using Nintex Workflow solutions, I believe this forum can provide more help: community.nintex.com/t5/Forums/ct-p/Nintex_Product_Discussion – Chelsea_MSFT Jul 13 '20 at 2:41
  • When you talked about detecting the number of existing items, I immediately thought of getting a COUNT, which doesn't come up in a column itself, so I immediately thought of a calculated column. That's where my assumption came in, and where that came from. At this point, the solution doesn't have to come from a workflow - I'm open to anything. – DanJ Jul 13 '20 at 17:39
1

Take a look at the tutorial video in this article: https://www.kalmstrom.com/Tips/SharePointListItemsLimit.htm.

I would suggest creating a Date column, and then a People column in your list. Then, create records for the 20 slots available on each date and follow his instructions to restrict anyone from creating new records on that list.

1
  • I've seen some of his videos before, and his approach does work - although it works for one list at a time only. – DanJ Jul 14 '20 at 19:20
1

Create a separate list for the available class dates. Like below. enter image description here

And create a new dummy 'class date' column in your primary list as a lookup column into the above list.

This dummy 'class date' lookup column will be visible to users while creating the new entry. But using the workflow you have to copy this value into your original date column while item is getting created/modified.

enter image description here

Check the total item count in the list (filter with date) in the workflow every time when a new item is created.

enter image description here

If the count == 19 (ie, 20th item is getting added), then delete the particular date item from the date list (through the same workflow) so that it wont be available further to add into the list.

6
  • Nice. In testing, I can't seem to get it to work, though. Here's what I've got in my workflow: In my query, the filter is equal to the date, like you said. The Sort (which is required) the field is currently set to the Item Child Count, and points to a variable (varClassDateCount) that I created. Then I have a RUN IF block, that runs if the variable ==19, with the block on the inside of that which deletes the item where the class date equals the class date in the current item. What am I doing wrong? – DanJ Jul 14 '20 at 19:15
  • You have to delete the item from the lookup list. And the count in the workflow should be taken based on the class date column. Ie, IF(count of list items where class date is equal to current item date ==19) THEN delete the item from lookup list WHERE date == current item date. – Jefin Mathew Jul 15 '20 at 3:26
  • Don't forget to copy the dummydatecolumn value (which is the lookup column in your primary list) to the actual date column. And deletion of the list item from the lookup list should happen at the last (Ie once the date value is copied from dummydatecolumn to actual datecolumn). – Jefin Mathew Jul 15 '20 at 3:49
  • I'm going to include screenshots of my Nintex workflows to show you what they're set at, so we can see what we need to change. They'll be included in my original post at the top. – DanJ Jul 15 '20 at 14:17
  • I think there can be some issues with data formats. You please log the values into history list and check once again. Be sure with the "equal to" statement, cause it may try to look for a date (AND TIME) equality! – Jefin Mathew Jul 15 '20 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.