Help

Ignore case for filterByFormula

Topic Labels: API
4699 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Peter_Lorentzen
4 - Data Explorer
4 - Data Explorer

Hi everyone!

I’m having a problem where matching a record using filterByFormula (through curl) is behaving in a case-sensitive way. I need it to ignore the case.

The request is constructed like this (Angular):

return $http({
  medthod: 'GET',
  url: api.BASE_URL + '/Members' + "?filterByFormula=(Email='" + email + "')",
  headers: {
    'Content-type': 'application/json',
    'Authorization': api.KEY
  }
})

api.BASE_URL and api.KEY are fetched from a config file and email is passed into the function. The resulting request URL is this:

<REMOVED BASE URL>/Members?filterByFormula=(Email=%27passed@email.com%27)

The problem is that this appears to ONLY find a record with that exact string, where I would like it ignore the case.

A possible workaround would be to force the email input field (the string being passed into the request) to be lowercase, but I would rather if this was fixed by ignoring the case.

I have looked through the API documentation, this forum and searched Google for anyone with the same problem but didn’t find anything useful.

Thank you for any help on this!

2 Replies 2
Tuur
10 - Mercury
10 - Mercury

Hi!

I think the following should work…

filterByFormula=(LOWER(Email)=%27passed@email.com%27)

Or additionally add another ‘lower’ around the email string you pass…

Thanks for that suggestion! Hadn’t thought of that. While it doesn’t answer the question on ignoring the case, it could be used to improve the possible workaround.