Use filters in REST API to filter Array field.

I have a table, which returns following response via REST API:

"City": "BORRALHA",
"Parish": "Borralha",
"CAE": [
"Projetos Relacionados": [
"Fontes de Dados": [


I want to filter result and get only records where CAE is 11029. So I used this REST API: ?filters={"fields":{"CAE":11029}} but I get blank result everytime. Is there any way to filter using array fields.

5 replies

    • Sean
    • 2 yrs ago
    • Reported - view

    Did you encode the filter criteria like this...




    Screen Shot 2021-06-13 at 6.30.36 PM



    • admin.10
    • 2 yrs ago
    • Reported - view

    Yes, Its encoded exactly it is mentioned in documentation.

    • Sean
    • 2 yrs ago
    • Reported - view

    I couldn't filter using a value of an array field. If someone else doesn't post a solution, you could attend one of the API webinars. Please share if you get an answer.

    • Kaan_Dikmen
    • 2 yrs ago
    • Reported - view

    I doubt you'll get it working with an array (which I guess is a multi choice field or some formula returning multiple items in an array?)

    I find checking for an item in an array not to be straightforward in any case in NX. My favourite approach is to concat the array and figure out a robust regular expression that should get me a clean true or false using testx. 

    Your best bet may be to wrap a NX query into the api using the query endpoint and query parameter, and see if that works. eg select YourTable[testx(concat(CAE), "\b11029\b")], url-encoded and appended to the below url structure. 



    from the API manual:

    Execute a Ninox Script

    With the following request you can execute any valid Ninox script against a database.

    Few things to consider -

    The output of the script will be streamed back as the response.
    Scripts having any compilation errors will terminate the request with a null reponse.

    The request can be executed using both GETand POST HTTP methods

    GET https://api.ninoxdb.de/v1/teams/:teamid/databases/:databaseid/query?query=1+2

    • Kaan_Dikmen
    • 2 yrs ago
    • Reported - view

    There's also the contains() function which may be simpler than testx()

Content aside

  • 2 yrs agoLast active
  • 5Replies
  • 1319Views