Did you know that you can use the number of selected products in conditional logic? You can!
How do I do this?
When configuring any conditional logic (question visibility, email logic, etc.), first select a Product question. If that question allows the user to select more than one product, more options will automatically appear in the same dropdown menu. You can then choose to base the logic on the quantity for a specific product, or the total quantity across all products in this field.
After selecting the desired quantity, you can continue and set up the logic like you would any other rule.
So what can I use this for?
This comes in handy for lots of use-cases like:
Selling tickets and conditionally capturing information on the number of selected tickets.
Configuring selected products (e.g. the size and color of T-shirts).
For a more in-depth guide, let's say we're using a field on our form to sell some brand merchandise.
When the submitter chooses "T-Shirt," we want to off a few different customization options for each of the tees that they order.
The first step is that we need to restrict the number of T-shirts the customer can order. We'll be creating a set of questions to be used for each of the selected tees, so we can't let the customer choose 1,000 (unless you want to create 1,000 groups of questions). For this example, we have set the maximum number of T-shirts per submission to 5 (pictured below).
Add a break to the form, and configure it to be visible when the selected product quantity is more than 0.
"More than 0" simply means that the content in this section will only be used when there is at least one T-shirt selected.
Beneath this break, add the questions that you would like to ask when the customer has selected at least one T-Shirt.
When you're happy with the set of questions, duplicate the group of questions multiple times until there is a separate group of questions for each potential item. In our example, we'll want five groups for the maximum five tees per order.
Above the second group of questions, insert another section break. We'll configure logic on this one just like the break we created in Step 2, except we want the rule to be when "T-Shirts Quantity is more than 1".
Repeat this for all of the rest of the question groups; "...more than 2" for tee #3, "...more than 3" for tee #4, etc.
You're done!
Gotchas
Depending on your needs, the breaks can either be full page breaks, or inline sections that display on the same page.
It's helpful, at least while setting up, to write some text above each question group so you can quickly identify what number you're up to.
If you don't care which product is selected, you can use the same kind of logic, but on the "Total Quantity" which sums up all of the selected products in the product question.
If you are using section breaks (showing the content on the same page, not on a new page), make sure you add a section break after all of the product-related questions. that is always visible if you have different questions or content that you would like to be visible on the same page.