Cognito Forms logo
Experience the future of Form Building Start Building Now!

Set Quantity Limits on Your Cognito Forms!

Posted by Nadia A. 08/31/2017 Categories: Feature Release

We're thrilled to announce that you can now set quantity limits on your forms! You can use quantity limits for product orders, ticket sales, signups, reservations, and just about any other scenario for which there's a limit to the number of times a specific value may be selected.

Setting limits

To get started, open up the form builder and select a supported field type. In the field settings, you'll find the Limit Quantity option; here, you can select No Duplicates to limit the quantity allowed to just one, or Specific Quantity to specify a quantity limit greater than one.

For example, to limit people to just one submission per email address, set the quantity limit of an Email field to No Duplicates. Then, write a custom error message to display when someone tries to enter the same email address more than once:

Quantity limits are also essential for managing product inventory. To set quantities for different products, select Limit Quantities from the Choice Options in the field settings. Then, specify a quantity for each choice option. Alternatively, leaving a quantity blank will ensure that quantity limits are not enforced for that choice option. 

After you set your quantities, make sure to include the error message that displays when a product is sold out ("Out of stock."). The error message can be static, or you can use some conditional logic to change the message depending on which choice option is selected:

=if Choice = "Product 1" then "Product 1 is out of stock." else if Choice = "Product 2" then "Product 2 is out of stock." else ""

Tracking quantities

Once you've set your quantity limits, you can also access the quantity limit, the quantity remaining and the quantity used for the selected/entered field value within calculations:

  • FieldName_QuantityLimit: The quantity limit for the current field value.
  • FieldName_QuantityUsed: The amount of times the current field value has been specified, including all submitted entries and changes reflected in the current entry.
  • FieldName_QuantityRemaining: The difference between the quantity limit and the quantity used. This value will be negative when the limit has been exceeded for a given field value.

Templates

Quantity limits come in handy in lots of different scenarios. To get started, check out our pre-made templates and take advantage of the ability to:

Have any questions about using quantity limits? Feel free to get in touch with us, or just leave a comment below!

 
 
Printable View