Skip to main content
Question

Utilize API_Add Record Response values

  • June 25, 2021
  • 0 replies
  • 66 views

Forum|alt.badge.img+3
Does anyone know how to get the API Response information to be able to utilize it in a redirect?  I have a button where I 'replace' a part, I want to show the new part after the API_Add Record call.  I can't seem to find it anywhere.   If I omit the &rdr line I end up on the API response, which clearly shows the new rid.  Button code below


Any thoughts would be great!  Thanks in advance.

var text url =
URLRoot() & "db/" & [_DBID_TEST_PARTS] & "?a=API_AddRecord" &"&apptoken="&[app token]
& "&_fid_73=" & URLEncode([Related SPARK Test Item])
& "&_fid_75=" & [Header - Label Header (ref)]
& "&_fid_80=" & [Related SPARK]
& "&_fid_205=" & [Fit Condition]
& "&_fid_135=" & [Additional Info]
& "&_fid_223=" & [Record ID#]
& "&_fid_125=true"
& "&_fid_72=" & $uselabel
& "&_fid_123=" & ([Replacement Counter] + 1)
& "&_fid_127=" & [Full Label]
& "&rdr="&URLEncode(URLRoot() & "db/" &Dbid() & "?a=dr&rid=" & URLEncode([Record ID#]));  //I want to utilize the newly created rid here.

If([Hide Replace Button]=true,"",
"<a class='Vibrant Success' href='" & $url & "'>Replace this part</a>")

------------------------------
Jeremy Myer
------------------------------
This topic has been closed for replies.

JimHarrison
Forum|alt.badge.img+16
  • Quickbase Alumni
  • December 7, 2021
When the button is clicked, everything after var text url = is sent to the Quickbase server.
To do what you are trying to do would require a Code page with javaScript that would run in the browser and handle the response.

1. change button to call code page
2. use https://resources.quickbase.com/db/bq8kmgrcq/72b77352-3b9d-495e-932f-1cd9f1b15fa3 to write the code page.

I am working on something like this now. If I can figure out a simple proof of concept, I'll put up a post.

------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------