Forums

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

Is there a way to disable text field case insensitivity for uniqueness in ConfiForms?

Kathleen Janiszewski
Contributor
June 7, 2023

I have a problem with case insensitivity on text fields with [unique] validation.  I'm trying to update "contractor" to "CONTRACTOR" in a text field, but ConfiForms apparently treats text the same whether it is upper or lower case, at least with the [unique] validation.  Does anyone know a way to disable case insensitivity or (same thing) enable case sensitivity?

2 answers

0 votes
Kathleen Janiszewski
Contributor
June 8, 2023

Sorry.   This was supposed to be a reply.

0 votes
Alex Medved _ConfiForms_
Community Champion
June 7, 2023

Hi

ConfiForms rule to validate uniqueness can be set to be case insensitive

Screenshot 2023-06-07 at 22.13.00.png

Alex

Kathleen Janiszewski
Contributor
June 7, 2023

The opposite is occurring.  This is my code:

 

 <p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="5b7f96d6-fe99-4134-b81c-7fe44091517f" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">title</ac:parameter>
<ac:parameter ac:name="fieldLabel">Title</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
<ac:parameter ac:name="validation">[unique]</ac:parameter>
</ac:structured-macro>
</p>

I want it to be the default, CASE SENSITIVE.  However, when I add "CONTRACTOR" from my ConfiForm registration, I get a validation error, because "contractor" is already being used as a title.  The it gets rejected because it is NOT unique, which tells me that it's CASE INSENSITIVE.

Thank you.

-Kathleen Janiszewski

Alex Medved _ConfiForms_
Community Champion
June 8, 2023

Have a look at the idea I have shared - using a different method (field definition rule type) to check the uniqueness...

I dont know how to "fix" yours, sorry

Alex

Kathleen Janiszewski
Contributor
June 8, 2023

Alex,

I got rid of [unique] and added the field definition rule, and I got the same results: I couldn't add a user with the title of "TESTING" because there was already one with the tile of "testing" .  Moreover, I couldn't change a user's title from "testing" to "TESTING".  But I could change it from "testing" to "testing 1-2-3", then change it from "testing 1-2-3" to "TESTING".

I can provide screenshots if you'd like.

Kind regards,

-Kathleen 

Alex Medved _ConfiForms_
Community Champion
June 8, 2023

Kathleen,

Please have a look at the following demo

http://recordit.co/eavrigALMK

Hope it helps

Alex

Kathleen Janiszewski
Contributor
June 8, 2023

Alex,

Thank you for the video.  I would record one if I could.  Here are some screenshots in order:

1) Notice the Validate Uniqueness rule with Case Insensitive UNCHECKED:

Validate Uniqueness of title.PNG
2) I change "TESTING":

reverted to uppercase testing.PNG
to "testing":
lowercase testing entered.PNG

3) This runs the update.action REST API call, and returns the following error which I (really another colleague's code originally) put into an alert:

Error on testing.PNG
Again, this works fine if I first change it to "testing 1-2-3" then to "testing".

Kind Regards,

-Kathleen

Alex Medved _ConfiForms_
Community Champion
June 8, 2023

Could it be that there is some other rule in the form that interferes?

Try recreating an example I have shared - does it work for you?

Alex

Kathleen Janiszewski
Contributor
June 8, 2023

Alex,

I have not created anything that simple.

There are many rules, but not on the "title" field.  Also, it's an update.action, so there's only 1 field changing.  I checked my code.  I never use "upper" or "lower" anywhere.  Could it be that it only happens with the REST API?

Kind regards,

-Kathleen

Kathleen Janiszewski
Contributor
June 9, 2023

Alex,

I tried it your way.  In order to get the registration macro to work, I had to remove [unique] from the Form Field Definition, but keep the Rule for Form Field Definition on the "title" field.  However, it STILL DOES NOT WORK with the REST API!  I get the error I show above.  I need it to work in ALL cases.  How do I do that?

Kind Regards,

-Kathleen

Alex Medved _ConfiForms_
Community Champion
June 13, 2023

What macro you have that has that "message"? I afraid this has nothing to do with the method I shared... (something else is conflicting)

My solution/example works with UI and with REST API... there is no difference

Alex

Kathleen Janiszewski
Contributor
June 14, 2023

Alex,

It works fine with the UI on the add.  However, then I use the REST API within the IFTTT macro, and I get multiple results, both "TESTING" and "testing" on the filter.action.  Since I must have a one-to-one correspondence, my code throws an error when the filter action returns mutliple results.

Thanks again.

-Kathleen

Kathleen Janiszewski
Contributor
June 20, 2023

Alex,

Actually, we use version 0:
https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Server+REST+API+version+0

However, my colleague came up with a solution that our customer is ok with.  We're going to force upper case in that field.  I already trim() it everywhere, so adding UPPER()/toUpperCase() should be pretty straightforward.

Thank you for your help!

-Kathleen

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events