Redirect to a record in another table after API Call using Java Script

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have a button in table1 records to run Javascript code page to create a record in table2 based on some values in table 1 records. After the new record is created in table 2, I would like QuickBase to open that record automatically. How can I do that?
Photo of NK23

NK23

  • 274 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
The API_AddRecord returns the RID.
https://help.quickbase.com/api-guide/add_record.html#Response_Values

Append that to the URL you use to view a record in the table replacing rid=123 with the returned RID from the api call. In javascript you can useĀ 
window.location.replace("url.com/dbid?a=dr&rid="+rid)
Photo of NK23

NK23

  • 274 Points 250 badge 2x thumb
Thanks, it solved my problem!