Forum Discussion

RobWhite_IV's avatar
RobWhite_IV
Qrew Trainee
2 years ago

REST API - doQuery - get record ids

How can I get record ID's for 'data' returned?  In the XML version I would specify rid=true or similar.  What do we do now to return field id=3?

Thanks,

~Rob



------------------------------
"The" Rob White IV
------------------------------
  • DougHenning1's avatar
    DougHenning1
    Community Manager
    Hi Rob,

    From the help, the select is an array of field ids for the fields that should be returned in the response. If empty, the default columns on the table will be returned.  So just include 3 for the record id.

    {
      "from": "bck7gp3q2",
      "select": [
        1,
        2,
        3
      ],
      ...


    Hope that helps!



    ------------------------------
    Doug Henning
    ------------------------------
    • OliverPolden's avatar
      OliverPolden
      Qrew Member

      The Record ID is a pretty important field. I think it should be returned in the default set of fields. I've just wasted a day trying to figure out how to create a record that has a relation to another table. If the Record Id was returned it would have been evident that is what I need to use in the related field.
      It is also not clear from the JSON API developer portal that you can do "select": ["a"] as part of your query which would also be very helpful to know.
      Once you've done a "select all" you can quickly see what data you have in the fields and then change the select to only the ones you need.



      ------------------------------
      Oliver Polden
      ------------------------------
    • RobWhite_IV's avatar
      RobWhite_IV
      Qrew Trainee

      Thanks, Doug.  

      That is helpful.  I guess I didn't think of SELECT acting as CLIST from the old api.  

      Do you know if there is a 'give me all fields' option?  Used to be

      clist = 'a';


      ------------------------------
      Rob White IV
      ------------------------------
      • DougHenning1's avatar
        DougHenning1
        Community Manager
        Hey Rob, I don't think that's possible in the REST API.  Do you really need all the fields? It's best to only select the ones you need to minimize the amount of data retrieved.

        ------------------------------
        Doug Henning
        ------------------------------