Clarity

Expand all | Collapse all

Case sensitivity with if condition in GEL

Jump to Best Answer
  • 1.  Case sensitivity with if condition in GEL

    Posted 11-19-2015 05:25 PM

    We are reading a file in GEL script and comparing the values in the Clarity database, looks like the "if" function is case sensitive when we compare the values.

    e.g. <core:if test="${CLR_UNIQUE_NAME == UserID}">

    CLR_UNIQUE_NAME=abc@email.com and UserID=Abc@email.com are considered different.

    Is there any GEL function to covert the string case?

    There is alternate way of doing is by SQL, but do not want to take that route unless required.

     

    Any help appreciated...



  • 2.  Re: Case sensitivity with if condition in GEL
    Best Answer

    Posted 11-19-2015 09:27 PM

    Assuming that CLR_UNIQUE_NAME and UserID are string objects you could do:

     

    <core:if test="${ CLR_UNIQUE_NAME.equalsIgnoreCase(UserID) }" >

     

    If they are objects and their toString methods get a string value of the object.

     

    <core:if test="${ CLR_UNIQUE_NAME.toString().toLowerCase() == UserID.toString().toLowerCase() }">

     

    V/r,

    Gene



  • 3.  Re: Case sensitivity with if condition in GEL

    Posted 11-20-2015 02:11 PM

    Thanks, worked