Hi,
I want to limit the number of entries a user can add for a smart multi-row field
The question here was helpful, however, my current configuration only works with Validation Rule (Dataset), so it considers already created records. In Fact I want the validation to be applied before the record is created (count the numbers of entires of smart multi-row field and when it exceeds x, show error message).
I changed from "Validation Rule (Dataset)" to "Validation Rule" for the action to be executed, but this does not work with the same config in "Conditions"
Can anyone help?
Further questions:
- The multirow list contains (will contain, when submitted) recipients of the form. I tried to implememt the email notification via IFTTT (screenshot), but this only works when only one "inventor" has been submitted via multirow. If more than 1, the form tells me that "the recipient list is empty"
- The user is supposed to enter the contribution of the individual inventor in the multirow. The overall contribution must be 100%. I know how to set a condition that the single contribution must not exceed 100 but don't know how to simply build the sum and then validate the sum of all inventors' contribution
You can just have a validation rule in the form that has the multi-row field like this
Alex
Thanks Alex, that's it!
I extended the original question, as my two further question are closely related. Maybe you can help here as well?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not s good way to communicate (by changing the original question)
but do you want the emails to be sent individually for each inventor or a single email?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, will consider for future questions. sorry.
An email notification about a submitted form should be sent to all inventors (as indicated in the multirow) once the form has been submitted,. No need to send individual messages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then the parameter for the IFTTT's recipient's list should be something like
[entry.inventorlist.transform(inventor).asList]
Regarding #2 - add a validation rule to utilize the "queryAndAggregate"
https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions
Condition would be something like (assuming the field to aggregate is named "contribution" and the form is "inventors" and it is on the same page)
_func.queryAndAggregate(inventors:@self;id:[entry.inventorlist.transform(id).join( OR id:)];[entry.contribution]):>100
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, where / how can I add the virtual function, is it a new e.g., "Calculated" field type?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, it is about the condition in the validation rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thought so... And your assumptions are correct
However, when I enter your proposed condition, there is no error message when I e.g., have a list of one inventor and set the contribution to 90. I am attaching a screenshot of my config
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should it fail when you set it to 90? It will when it's exceed 100, summing up all the inventors and their contribution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should fail when not 100 (contributions must be added to 100% across all inventors).
I also changed the formula to <100 (and <>) but still no error when 90 are entered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to develop a custom script that counts the existing entries before creating a new record. This script can be triggered before the record creation process, ensuring that the limit is enforced in real-time.
Sample Script:
#set($count = 0)
#foreach($row in $smartMultiRowField)
#set($count = $count + 1)
#end
#if($count >= 5) ## Assuming 5 is the maximum limit
## Show error message or prevent form submission
"You cannot add more than 5 entries."
#end
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.