Quick Question, is it possible to sum Input fields to give them “dynamic” valid min and max limits.
So for better understanding, I have a Repeating group of 3 “Products” and the customer can choose 5 Products out of this 3 Product lines. how can I adjust the input field in a way that he can add the Sum of 5?
fex:
Product 1 = input 1 (so for product 2 & 3 the sum will be 4)
when the next choice is Product 2 = input 3 ( so for product 3 the sum will be 1)
How can I validate that ??
The problem is the other way round and input 1,2,3 are within a repeating group.
So if input 1 would be 3 as a quantity the remaining quantity would be 2.
So the customer would have the choice to eider select 1 (Quantity) and 1 (Quantity) in the remaining input fields, or 2 (Quantity) in one of the remaining input fields and than 0 (Quantity) would be in the remaining in put field.
The problem is the other way round and input 1,2,3 are within a repeating group.
So if input 1 would be 3 as a quantity the remaining quantity would be 2.
So the customer would have the choice to eider select 1 (Quantity) and 1 (Quantity) in the remaining input fields, or 2 (Quantity) in one of the remaining input fields and than 0 (Quantity) would be in the remaining in put field.
I added a repeating group to the demo page (you can ignore the stuff outside the repeating group). Go ahead and make different selections with the dropdowns to see the behavior.
The RG has 3 products, so 3 rows. Each row has a dropdown with options from 0-5. The data source of the dropdown is a “list of numbers” from the toolbox plugin.
I’m also using the RG Extractor plugin to extract the dropdown values from each cell. You’ll see a “Transmit Data” element in the cell, and a “Receive Data” element outside the RG.
The real logic is in the dropdown’s default data source and the condition to change the data source slightly when there’s already a value in the dropdown.
So the filter is comparing the sum of the already selected quantities + each number in the “list of numbers” and if that result is less than or equal to 5, it stays in the list.
The condition has to subtract the currently selected value to achieve the same comparison.
Look through the expressions and let me know if I can help explain any part of it further.