How Do I Validate a Composite Key Before the Submit is Executed?

Kathleen Janiszewski May 1, 2023

I've create a ConfiForm Rule fore Field Definition.  I've already created a composite key called "uniqueId" which consists of CONCAT("[entry.recordOwner]","[entry.userType]").

When I try to "Validate uniqueness" on this field, it will give an error message if the recordOwner (userId) is in there.  It seems to not make any distinction for the composite key.

I need this because each user can have an entry of each of 2 types.

What am I doing incorrectly?

Validate Uniqueness of Unique Id - Part 1.PNGValidate Uniqueness of Unique Id.PNG

1 answer

0 votes
Alex Medved _ConfiForms_
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.
May 1, 2023

Hi @Kathleen Janiszewski 

The parameter "Field names to be used to construct unique key" expects a comma separated list of field names (you must be using some old version of ConfiForms where the description of the field was still missing - sorry about that)

So just put

recordOwner,userType

No need for any extra field or any other parameters in this macro

Alex

Kathleen Janiszewski May 2, 2023

Alex,

Thank you for your reply.  It turned out not to be this complicated.  I only needed a Validation Rule of [unique] on my field, uniqueId.

Thank you.

-Kathleen

Alex Medved _ConfiForms_
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.
May 2, 2023

That is an alternative way of doing this, but the Validate uniqueness rule is even easier in my opinion... but that is for you to decide and pick what is best for you 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events