Discussions

Expand all | Collapse all

Sending Variables with HTML

  • 1.  Sending Variables with HTML

    Posted 06-20-2018 18:29
    The title is not quite accurate. I am trying to use the RID and other informatation from a record in an HTML page off a Formula URL button on the same record form. 

    var number RID = [Record ID#];
    var date PolEffDate = [Pol Eff Date];
    var text DOT = [DOT Number];

    "https://user.quickbase.com/db/DBID?a=dbpage&pagename=InvoicePDF.html?rid="&[Record">https://ctc.quickbase.com/db/bm9rv78gs?a=dbpage&pagename=InvoicePDF.html?rid="&[Record">https://user.quickbase.com/db/DBID?a=dbpage&pagename=InvoicePDF.html?rid="&[Record ID#]

    I obviously know that HTML cannot handle these variables. Is there anyway to get access to the RID from a button click into an HTML page? I will be using JS and Jquery once I have access to the RID. I am only trying to do this so I can have a custom HTML page that will then run the code. Any help is appreciated!


  • 2.  RE: Sending Variables with HTML

    Posted 06-20-2018 18:39
    Within the code page use this script 
    var urlParams = new URLSearchParams(window.location.search);
    urlParams.get("a"); // "dbpage"
    urlParams.get("pagename"); // "InvoicePDF.html"
    urlParams.get("rid"); // value of [Record ID#]
    You used to have to use a library to parse the query string but now we have URLSearchParams native in JavaScript.


  • 3.  RE: Sending Variables with HTML

    Posted 06-20-2018 18:42
    BTW, you have a typo in your URL formula - should be:

    "https://user.quickbase.com/db/DBID?a=dbpage&pagename=InvoicePDF.html&rid="; & [Record ID#]

    VERY STRANGE - The Forum is messing up my correction by adding a semicolon. You have a question mark instead of an ampersand in your original formula before "rid=


  • 4.  RE: Sending Variables with HTML

    Posted 06-20-2018 19:03
    The issue I have when using the above url is that it will link to a page that doesn't exist. It will take the RID and use it as a part of the redirect and so it will not link properly.


  • 5.  RE: Sending Variables with HTML

    Posted 06-20-2018 19:04
    Never mind I saw the correction and now it works! Thanks Dan!