Forum Discussion
- _anomDiebolt_Qrew EliteApplication Tokens are associated with Applications not individual tables. Additionally, there can be several Application Tokens associated with an Application. Given these two observations it isn't clear what your original question is asking or what you are trying to accomplish.
In any case when you are trying to automate some task across your entire account it can be problematic using the API because there is often no common Application Token to use within your script (unless you manually set this up). In these cases you can still write the script but you have to use non-API methods. This may seem unusual if it is your first exposure to the technique but you can GET or POST to any QuickBase endopoint URL using AJAX methods. - RohitAgarwalQrew CadetYou didn't get my question.
API that gives me DBID w.r.t to table name means I pass table name as the parameter and I get the DBID.- _anomDiebolt_Qrew EliteSo where does the part about "App Token" fit into your reformulated question?
- _anomDiebolt_Qrew Elite> I pass table name as the parameter and I get the DBID.
Like this:
var name = "250 Bottles of Beer on the Form";
$.get("main?act=API_GrantedDBs")
.then(function(xml) {
var dbid = $("dbname", xml).filter(function() {
return $(this).text() === name;
}).next("dbid").text();
console.log(dbid);
})
//output
bj4vxvurn - _anomDiebolt_Qrew EliteOr this version which employs Async / Await:
(function(){
async function getDBID(name) {
var xml = await Promise.resolve(
$.get("main?act=API_GrantedDBs")
);
var dbid = $("dbname", xml).filter(function() {
return $(this).text() === name;
}).next("dbid").text();
return dbid;
}
var name = "250 Bottles of Beer on the Form";
getDBID(name).then(function(dbid) {
console.log(dbid, name)
});
})();
//output:
//bj4vxvurn 250 Bottles of Beer on the Form- RohitAgarwalQrew CadetThank you so much,
One last question.
Is there any API to get Application ID.
for ex-
I am in Application X. I write some script in order to get Application ID. - _anomDiebolt_Qrew EliteJust dip into one of QuickBase global variables:
gReqAppDBID - RohitAgarwalQrew CadetWhere I will find this gReqAppDBID Global Variable.