Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

unique not working?

Alan Nelson August 19, 2021

I have a simple form that has a name field that is created dynamically. When I set the validation for that field (it's a Read Only field) I get a validation error whether the name exists or not. I cannot get past it.

3 answers

1 vote
Alex Medved _ConfiForms_
Community Champion
August 20, 2021

Hi @Alan Nelson 

The question is incorrectly marked as for bitbucket and that caused a lot of confusion

Actually it is about ConfiForms and ConfiForms is only available in Confluence (server and cloud)

Here is what you can do (2 options): http://recordit.co/vN28CsxTdC

Enclosing storage format for you to copy

<p>
<br/>
</p>
<p>Check with [unique] on the field definition</p>
<ac:structured-macro ac:macro-id="f2b7d1a9-533d-4c97-97e1-de52e87bd4b5" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="ad7e81e7-b694-4d6e-a661-f4b3a213bb68" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="dd0cd355-8787-4c9f-a569-a8bf723125b9" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">uname</ac:parameter>
<ac:parameter ac:name="fieldLabel">uname</ac:parameter>
<ac:parameter ac:name="validationMessage">Unique Name field value must be unique</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
<ac:parameter ac:name="validation">[unique]</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>Check with validation rule</p>
<ac:structured-macro ac:macro-id="1e8e2a8c-e8a7-4ba4-8a17-eea81f119374" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f1</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="a74ceea2-b6fd-4a5f-9413-c1ca9750c769" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="ff1e30f0-4073-4f6d-b683-03c9336858f0" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">uname</ac:parameter>
<ac:parameter ac:name="fieldLabel">uname</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="5d9f574f-ed93-4e00-9c7f-ffd299ceafa2" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">uname:[entry.uname] AND _count:&gt;1</ac:parameter>
<ac:parameter ac:name="fieldName">Unique Name field value must be unique</ac:parameter>
<ac:parameter ac:name="action">Validation rule dataset</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

Hope it helps

Alex

Alan Nelson August 26, 2021

Thank you Alex, the issue was on my rule to create 'uname' (CONCAT 2 other fields) I was running it as a validation (Field name was blank) rather than having it watch a specific field. Once I changed that it worked.

0 votes
Alan Nelson August 19, 2021

Problem = [unique] validation validate EVERYTHING as existing

What Form? = My ConfiForm

What name Field? = It's called 'uname' and is filled when the form is created using the values from two other fields.

Validation = in the 'Validation Rules' of the field I have '[unique]'

Error = "Unique Name field value must be unique" It throws this error no matter what I put in the field.

Alan Nelson August 19, 2021

It even throws when it's blank.

0 votes
Nic Brough -Adaptavist-
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.
August 19, 2021

Could you explain in a bit more detail what the problem is?  What form?  What name field?  What is creating it dynamically, and what is the validation?  (And the validation error?)

Alan Nelson August 19, 2021

Problem = [unique] validation validate EVERYTHING as existing

What Form? = My ConfiForm

What name Field? = It's called 'uname' and is filled when the form is created using the values from two other fields.

Validation = in the 'Validation Rules' of the field I have '[unique]'

Error = "Unique Name field value must be unique" It throws this error no matter what I put in the field even left blank.

Like Nic Brough -Adaptavist- likes this
Nic Brough -Adaptavist-
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.
August 19, 2021

Thank you for that!

I know I did a barrage of questions, but I was very stuck on where the problem was.  I'm not familiar with Confiforms in Bitbucket, so I'm stuck, but hopefully there's someone who can help out!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events