Limit the numbers of smart multi-row // email all users indicated in this multi-row // build sum

Ulrich Bonda December 4, 2024

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"


Capture.PNG

- 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

2 answers

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2024

Hi @Ulrich Bonda 

You can just have a validation rule in the form that has the multi-row field like this

Screenshot 2024-12-06 at 18.08.16.png

Screenshot 2024-12-06 at 18.08.24.pngScreenshot 2024-12-06 at 18.08.31.png

Alex

Ulrich Bonda December 8, 2024

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?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

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?

Ulrich Bonda December 9, 2024

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.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

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

Ulrich Bonda December 9, 2024

Thanks, where / how can I add the virtual function, is it a new e.g., "Calculated" field type?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

No, it is about the condition in the validation rule

Ulrich Bonda December 9, 2024

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

Capture.PNG

Ulrich Bonda December 12, 2024

Any idea?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 12, 2024

Should it fail when you set it to 90? It will when it's exceed 100, summing up all the inventors and their contribution

Ulrich Bonda December 16, 2024

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

0 votes
Humashankar VJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2024

Hi @Ulrich Bonda 

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

Ulrich Bonda December 8, 2024

Thanks @Humashankar VJ

I found the solution from Alex easier to implement :)

Like Humashankar VJ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events