Skip to main content
Question

How to display the table name from dbid

  • November 8, 2018
  • 0 replies
  • 115 views

JimHarrison
Forum|alt.badge.img+16
This may be obvious but I am not finding a solution anywhere.
I have a field where the dbid is input as text. I want to use a formula field to convert the dbid to the table name. Is this possible?

Forum|alt.badge.img+17
  • Community Moderator
  • November 9, 2018
Hi Jim,

I can confirm unfortunately there isn't currently a pre existing formula function to convert a DBID into the corresponding table name. It is possible someone may have a non-native solution but using the native formulas there isn't one at this time. 

  • Quickbase Alumni
  • November 13, 2018
Here is a novel solution. Paste this code into the console and it will generate a Case() formula that will lookup the dbname from the dbid:
var formula = "Case([dbid],\n";
$.get("main?act=API_GrantedDBs")
  .then(function(xml) {
    $("dbinfo", xml).each(function() {
      formula += '  "${$("dbid", this).text()}", "${$("dbname", this).text()}",\n';
    });
    formula += '  ""\n)';
    $("body").prepend("<textarea id=mytextarea>");
    $("#mytextarea").val(formula);
  });
The formula will appear in a <textarea> that is spliced into the top of the page where you can copy the formula definition.