Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: info from Chris Z. in Teams

...

Warning

When using this form of the function:

find(String typeCode, int startRow, int maxRows, String sortBy, List<String> fields, Filter ... filters)

i.e. the one with the "fields" parameter,  you get back "full objects" which are transferred through type conversion.

If you do not use the "fields" parameter, you get only raw data for attributeXX fields, which is always a string. That means you will get a hashmap where all values are stringstrings – if you have numbers in the table, you will get back a string!

...

Limitations of api.find()

There are two several things you have to be aware of when using the search methods:

  • The number of rows the method api.find can return is limited by a server parameter. It is configurable per partition and by default it is set to 200. You can retrieve the max rows by calling api.getMaxFindResultsLimit. Read how to overcome this limitation below.
    (info) A warning is displayed if the number of returned rows returned equals 200 or formulaEngine.script.findMaxResults and the maxRows parameter of the find was not specified (=0). 
  • When filtering the attributed fields (attribute1, ..., attribute30), you need to pass strings to filters because all attributed fields are stored in the database as strings. This is mainly an issue with Dates. Find out how to convert them properly.
  • Because of the previous point, you cannot use sorting on numbers (integers, real) because api.find returns and sorts the data as strings. When sorting ($100, $70, $25) ascending, the result will be ($100, $25, $70).
  • Using api.find/api.stream it is not possible to retrieve the typedId field. These methods produce a DB query and in the DB we store an "id" field. So, to get typedId you would have to manually concatenate the "id" and "type" fields with a dot in a postprocessing logic.

Sorting

If you need to sort the data by a specific column, use the method overload which allows you to specify the sortBy parameter. You can sort by several attributes, separated by commas.

...