Lower case doesn't work when trying to retrieve records

Lower case doesn't work when trying to retrieve records

I use a secondary form where people write their e-mail and my application then searches on my primary table for a match.
If a match is found, then all other fields in my secondary form are automatically populated using data from the primary one.

The only problem is that when I do the comparison between the sumbitted e-mail and the ones that I already have, there is a distinction between lower case and upper case e-mails.
So myemail@gmail.com is actually different from MYEMAIL@gmail.com.

I thought I could very easily solve this by converting both e-mails in lower case and then compare the results.
However, this is not working, and I think because of the way Zoho is trying to fetch records from my primary form.

The following code works great but has a problem with lower/upper case e-mails:
   if (count(ITPRO_form[E_mail == input.WPEmail])  >  0)
    {
        MyRec  =  ITPRO_form  [E_mail == input.WPEmail];

When I 've tried to just add .toLowerCase() after my strings:
   if (count(ITPRO_form[E_mail.toLowerCase() == input.WPEmail.toLowerCase()])  >  0)
    {
        MyRec  =  ITPRO_form  [E_mail.toLowerCase() == input.WPEmail.toLowerCase()];

I 've got this error:
Error in statement at line number 22
Either the left or the right expression in a boolean expression in the criteria has to be a Form/Table Variable

Can anyone help?

Thanks!