You could pass just the [Record ID#] and within the script perform an AJAX call using
API_DoQuery or
API_GetRecordInfo using just one "passed" variable.
A second technique is to augment the IOL variable [-] with some HTML element (typically <a>, <div>, <span>) that has
data attributes. Here is a button that passes
[Record ID#] and
[Name] through a
data attribute:
[iol] & "moduleTable5.js" & [/iol]
&
"<a class='QBU_Button Vibrant Success' " &
" data-rid='" & [Record ID#] & "'" &
" data-name='" & [Name] & "'" &
">Button</a>"
And then read off the data attributes within the script using
this.dataset:
(function(){
var dbid = "bj5c9b9nb";
var dbidTable1 = "bj5c9b9pr";
var dbidTable2 = "bj5dnm78i";
var dbidTable3 = "bj5dnnsgm";
var dbidTable4 = "bj5dnpb46";
var dbidTable5 = "bj5dwp4f5";
var dbidTable6 = "bj5dwq9dx";
var apptoken = "c7fsvsnb7x6327d7an2ncd2k7vq";
$.ajaxSetup({data: {apptoken: apptoken}});
$("a.QBU_Button").on("click", function(event) {
console.log("moduleTable5.js");
var rid = this.dataset.rid;
var name = this.dataset.name;
console.log("rid=", rid);
console.log("name=", name);
console.log("this", this);
});
})();
Note that you can't use data attributes with fields that contain text that cannot be included in an attribute so use this technique for simple text, number date fields but not multi-line text fields.
A third technique it to pass absolutely no parameters but within the script scrape the rid out of the HTML or reference the global
kRid and then perform an AJAX query for the rest of the fields as above.
The point of all of these approaches is to make your formulas as clean and readable as possible and avoid placing script into the QuickBase Formula. You will have endless problems debugging your formulas if you insist on placing JavaScript in them because you have to escape all sorts of characters. Get out of the formula language and into script as fast as possible.