What is the "Redirect Mark" technique?

  • 1
  • 2
  • Question
  • Updated 3 years ago

The "Redirect Mark" technique is a method of using API_ImportFromCSV in a formula URL so as to avoid the use of multiple rdr parameters and multiple calls to API_AddRecord.

I hesitate to give you this information because instead of killing the use of rdr altogether (in favor of script!) you are probably just going to make a cottage industry out of using API_ImportFromCSV in formula URLs and eventually tackle even more complicated tasks by adding a dozen rdr's on the new scheme. 

The trick to using API_ImportFromCSV as a formula URL is to string out the record_csv parameter with a newline (\n) in between records of CSV data and to URLEncode() the whole thing. 

There is an example coded in this application:

Avoid Excessive Redirects ~ Add Three Stooges

Formula for Button:

var Text csv = "Moe Howard,6/19/1897,125" & "\n" &
  "Curly Howard,10/22/1903,87" & "\n" &
  "Larry Fine,10/5/1902,115" & "\n"  &
  "Shemp Howard,3/11/1895,120";

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_ImportFromCSV" &
  "&apptoken=cqzpjxqd6kg4rxwewqg4dye6jf3" &
  "&clist=6.7.8" &
  "&records_csv=" & URLEncode($csv);

var text URLTWO = "https://haversineconsulting.quickbase.com/db/bk7ne8qi3?a=q&qid=1";

$URLONE & "&rdr=" & URLEncode($URLTWO)

My example was quickly thrown together and it may not make a bunch of  sense to add three hardcoded records to the same table. However, I don't think you will have any problem getting real results from this example. Instead of hardcoding the CSV data you can build up the blob of CSV using formula fields and logic.

This new technique will certainly set the progress of QuickBase behind a decade in terms of using script. But Service Workers is coming soon so it will not matter. Prepare top be assimilated.

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
  • 2

Be the first to post a reply!