I want to retrieve records containing strings of more than a certain length in a certain column. SQL has a LEN function, but the function apparently is not supported by Backendless in the REST console. Is there a way to achieve the search / WHERE that I want?
Hello @Howard_Jacobson
Unfortunately for now there is no way to get the field’s length. I have created an internal ticket to add the function, it will be released in 2-3 weeks.
Hi Howard,
Here’s a solution for you:
-
Create a generated column in the same table with the formula shown in the screenshot below. In that example, my generated column name is
nameLength
and it calculates the length of the value in the columnname
:
-
Now my data table looks as shown below:
-
The
nameLength
column can be used in where clause:
Hope this helps.
Regards,
Mark
We have added support for the LENGTH function in where clause and properties. The correct syntax should look like this:
where=LENGTH(<source column>) > x
property=LENGTH(<source column>) as NewFunction
Regards,
Marina