Case sensitivity check comparing a list of objects with an input string.

0
I have a string x and a entity A(attribute a). Need to check if the string matches with any object of the database A by x=A/a. The condition is 1st we need to set x and a in the same case and then compare to remove any case sensitivity issues. But when I try applying an xpath for the retrieval of A as [toUpper(x)=toUpper(a)] i am not able to use toUpper function. How can I do it without using a loop or a list operation ?
asked
2 answers
0

The xpath function contains() is case-insensitive, so that may be a way out.

https://docs.mendix.com/refguide/xpath-contains

I hope this helps.

answered
0

Hello Shivani,

Using the strategy that Michiel came up with, you can have

[starts-with(Attribute, $Variable) and length(Attribute) = length($Variable)]

to make your comparison case insensitive. If the attribute starts with the same text (case-insensitive) and has the same length, it must be the same (case-insensitive).

Regards,

Paul

answered