SOLVED

How can I limit the number of items that can be entered into a list?

Brass Contributor

I want to limit the number of items that can be entered into a list.

Anyone have any suggestions on how to achieve that?

 

Thx in advance for any help.

20 Replies
with no other details, could do an on-create workflow that auto-deletes any item where ID is greater than max number.

if ID > 10, delete current item

Hello,

 

I'm not sure if there is a way to actually do what your asking but there is one idea that came to mind if you would like to give it a try.

 

I created a test list that has a Choice column that has some numbers or text. (I used numbers 1-3 for my choices.) Once that was set I made the column required and also set it to enforce unique values. This requires users to use the column and then only allows each choice to be used once in the list. Therefore if I have 3 choices there will only end up being 3 items in my list at any given time. (unless i delete them)

 

In a way I'm using the enforce unique values column setting to limit the data that is used in the list overall. Feel free to play around with this concept.

What is the context of limiting the number of list items?

As the earlier replies suggest, will those items need to be unique, or is it just a sequential list that needs to stop at certain point?

 

I've also wanted to do something like this in order to create a list that users can use to sign up for a class or event with a limited number of seats.

 

Would be great to be able to set the limit to, let's say 20 items, users trying to add more items should get a message saying this specific list is full. (custom message would be even more lovely)

We're having an annual "Summercourse" with various breakout sessions. Our employees can sign up for three breakout sessions of they're choise. Each breakout session has a limited number of seats available.

 

I've made a list for every breakout session, where people can put they're name up (O365 accountname), and would like to limit the number of entry's possible to the maximum number of seats available for that session.

That is exactly what we want to use it for.

Can we apply JavaScript onto that list?If so ,this will be more easy Ma'am.

 

Viipiin

best response confirmed by Yvonne Klomp (Brass Contributor)
Solution
You may be better off listing all sessions in one list with spots available

user registrations using a forms which go into another list, this form has a lookup to the sessions list with a filter to only show sessions with spots > 0. And a workflow on each registration to take a spot available from a session each time a person registers.

This would need to be an enhancement to out of the box forms using javascript, powerapps or another 3rd party forms product

Two possible approaches:
(1) Create a master list that will take registrations and a workflow that copies item into each breakout session list, or

(2) Create separate breakout sessions and have a workflow that starts automatically to check whether you've reached the maximum number of seats.


In both cases, you may have to include a hidden/restricted list that keeps track of the count. It will be more complex if you have to factor allowing 1st, 2nd or 3rd choice. I hope that helps.


FY

Thank you all very much for suggestions. You were most helpfull!

 

@Warwick Ward, I tried you approach and it does the trick!

One master list with all sessions and places available.

One registrations list, with a lookup field to the masterlist, entry form shows only sessions that have places available.

When a registration is entered succesfuly a workflow kicks off and adjusts the number of available places in the masterlist.

Works just like it was meant to.

 

Thanks again!!

I use what I call the "clip board" technique. For each session I set the number of seats available using a seat number column. Then make a view with the edit button next to each available seat and remove the toolbar so no one "can" add additional seats. I've done it for years, never had a problem.

In SharePoint no of list item Threshold limit defined on tenant level, if you want to limit the number of items reach out to tenant admin. Other side if you want limit the list  items in view then modify List view setting no of items you want to view.

 

Using developed a custom even receiver we can also limit the items that can be entered into a list.

 

Hope this helps!!

Hi, I think we can achieved by using SharePoint designer List workflow.

Create a SharePoint List Workflow on New Item Added.

Add a variable VarMaxVal and store max Val like 10

Add condition steps , If List field (ID) > VarMaxVal

  Action Delete current Item.

 

I hope this helps!! 


@Yvonne Klomp wrote:

Thank you all very much for suggestions. You were most helpfull!

 

@Warwick Ward, I tried you approach and it does the trick!

One master list with all sessions and places available.

One registrations list, with a lookup field to the masterlist, entry form shows only sessions that have places available.

When a registration is entered succesfuly a workflow kicks off and adjusts the number of available places in the masterlist.

Works just like it was meant to.

 

Thanks again!!


Hi @Yvonne Klomp I  am very much new to the sharepoint world. Would you mind sharing a bit more details on how you managed to setup this subscription list ?

Thank you in advance

Beata

Hi there,  I know time has pasted since this issue was added, But would you be willing to share the steps you took to accomplish this. If can included scripts also if needed. thanks@Yvonne Klomp 

This is so needed when your not a Sharepoint wizzard and just a teacher in a school! @Edvard Wikström 

@Sabine Rietstap, te 

Had a similar need today, and it turns out the solve is relatively simple.  Just use the COUNT function in the validation formula against any of the fields available.  I happened to have used the system Created (by) field but really, any should work!  Enjoy!


2021-06-29_15-50-04.gif

@mlai5241

 

Hello; 

 

I know it's been a while since you provided this solution, but I tried to use the COUNT function in the formula, on any of the fields available, but the message pops up when I try add a new element.

 

I will try again at work and see if I didn't make a mistake.

For those of us that don't want to try programming this is a dirty way to get a limited list in Teams. Create an Excel spreadsheet in the teams channel with the columns you want. The last column run the number of rows you need 1 through say 200 (an example as many rows as you want). Save the spread sheet. Create the list using an excel spread sheet. Find your spreadsheet and follow the instructions which include setting the range you want as a table include all the columns and counted rows. Once you have refreshed and the table is in the list. Go to list settings and hide the counted row. This will give you a list with 200 empty rows that participants can fill in. It isn't pretty but it is fast. @Yvonne Klomp 

1 best response

Accepted Solutions
best response confirmed by Yvonne Klomp (Brass Contributor)
Solution
You may be better off listing all sessions in one list with spots available

user registrations using a forms which go into another list, this form has a lookup to the sessions list with a filter to only show sessions with spots > 0. And a workflow on each registration to take a spot available from a session each time a person registers.

This would need to be an enhancement to out of the box forms using javascript, powerapps or another 3rd party forms product

View solution in original post