How can I get a value from a specific field from a record if I know the record ID and field ID using API?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I'm writing an application to read and write records to a QuickBase. I can query all records to get records that have matching values, but I want to know if there's an easier way to get a specific value stored in a specific field of a record if the record ID is known without having to query all records first. 

Such as: get the value in FID 5 from record 123. Instead of querying all records with record ID 123, then parse the response for the the value in FID 5.

(Hope that makes sense.)

Photo of Luis

Luis

  • 0 Points

Posted 3 years ago

  • 0
  • 1
I see that there is an API called API_GetRecordInfo.  Does that do what you need?  It returns the value for each field on a single record.
Photo of Luis

Luis

  • 0 Points
I was hoping for a way to return just the value in the specific field instead of having to parse through the response that contains all the fields to find the specific FID and value. If that isn't possible, then this can work. Thanks!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
You can use API_GetRecordInfo but if you are given only the field ID (veruss the field label) you have to do a little work to both parse the XML (unavoidable) and locate the field <value>. See this code (untested):

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=514


L>I was hoping for a way to return just the value  ...

All AJAX requests return promises not values. This is because AJAX request are asynchromous (they take an variable and unpredictable amount of time to return a response). A promise is a container which at some future time in the future will hold the response (when the promise resolves). The promise from an AJAX call is returned immediately from the AJAX call but it will not hold the response value until it is resolved. A promise is like a claim check for your coat at the theater or a "next in line" ticket at the bakery or meat counter.