0

Query multiple columns from API

Hi I want to query several columns from my API, this example only shows how to query one. How do I query more columns? 

https://api.ninox.com/v1/teams/mnPLY6DMsvq9wz4id/databases/pt53j1tburs8/query?query=(select Contact).'First Name'

https://docs.ninox.com/en/api/public-cloud-apis

Thanks, Gert-Jan

5 replies

null
    • GertJan_van_der_Kamp.1
    • 2 yrs ago
    • Reported - view

    Sorry about the layouting btw, was in a hurry to get oiut the door. I can;t seem to edit a question after it has been posted on this forum. 

    • Sean
    • 2 yrs ago
    • Reported - view

    I don't think you can do it that way, even though you can do it in the Mac app, e.g, (select YourTable).(YourField1 + YourField2). You can check with support to see if they have a solution.

     

    I tried that format in an API "query" and it didn't work. The way I did get it to work was to request all the records (you can filter if you want) of a table and then parse the result for the columns you want. Ninox have changed API documentation and I don't see this anymore, but it still works...

     

    http("GET", "https://api.ninox.com/v1/teams/YourTeamID/databases/YourDatabaseID/tables/YourTableID/records", {
    Authorization: "Bearer " + NK,
    'Content-Type': "application/json"
    }, null)

    • GertJan_van_der_Kamp.1
    • 2 yrs ago
    • Reported - view

    Hi Sean, thanks for the reply.

    The second method is what I'm doing now but the table has becoming bigger and wider so this leads to quite some overfetching. Indeed can't any format with mulitple columns to work, just returns 200 Ok with content null. Guess it'll have to be less eficient for now.. 

    • Sean
    • 2 yrs ago
    • Reported - view

    Hi Gert-Jan,

    I figured if it worked in the Mac app it should work through the API so I tried it using URL-encoded format of "+" and it worked. Just use %2B between each field you want to return...

     

    "https://api.ninox.com/v1/teams/YourTeamID/databases/YourDatabaseID/query?query=(select YourTable).(Field1%2BField2%2BField3)"

    • Sean
    • 2 yrs ago
    • Reported - view

    You can also use a separator like | in the coding to help you split the fields...

     

    Field1%2B%22%7C%22%2BField2

Content aside

  • 2 yrs agoLast active
  • 5Replies
  • 435Views