Forum Discussion

PaulStreit's avatar
PaulStreit
Qrew Member
5 years ago

Conditional formula-URL fields

I have a long string of code in a formula-URL field that results in a URL that is too long for the browser to execute (I verified this). So I want to break the code up into two fields, where part of the processing is done in the first field plus a checkbox field is set to trigger the second formula-URL field. But for whatever reason the second field does not recognize when the checkbox is set.

The code in the first formula URL field works and properly sets the checkbox field named "Trigger" and then redirects to the app's home page to avoid the standard QB response message to a successful operation. The code for the second formula-URL field is listed below. Any idea why this doesn't work? To be clear, after the redirection back to the home page I verified that the checkbox is set, so I know that the code inside the If statement did not execute since otherwise it would be set to "false". Thank you for any insight and how to fix this. I must be missing something.

Paul Streit
----------------------------------------------
var text setCheckBox = URLRoot() &"db/" & [_DBID_TEST] & "?a=API_EditRecord&rid=1&_fid_8=" & URLEncode(false);
var text reDirect = URLRoot() &"db/" & Dbid() & "?a-dbpage&pageID=101";

If(,
$setCheckBox & "&rdr=" & $reDirect,
$reDirect
)

------------------------------
Paul Streit
------------------------------
  • The only way you can trigger a subsequent action from Quick Base is by using an Automation.  

    A formula URL cannot be triggered by changes to records. 


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • PaulStreit's avatar
      PaulStreit
      Qrew Member
      Thank you, you answered the question and I’ll use an automation.

      Regards
      Paul

    • PaulStreit's avatar
      PaulStreit
      Qrew Member
      Mark,

      I meant to ask one more question. I can use an automation as you suggested below, but once processing is complete, I’d like to refresh the report or home page the user was looking at. I didn’t see any actions in an automation that does that. Can a pipeline call the home page, run a code page, or run a report, and be triggered when the automation finishes processing?

      Thank you,
      Paul

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Yep, we know how to go crazy on New Years Eve. It's ok, I'm three beers in and it's still 3 hours to the ball drop.

        In a word. No.  That would take an actual JavaScript Code Page.
        There is syntax we use however to execute a single URL and then delay the refresh for X seconds. You chose X long enough to allow the Automation time to complete.  Typically that's a second or two.
        Here  is the syntax for a 2000 millisecond delay. (2 seconds)

        var text URL = ... a singe API goes here.

        // slow refresh
        "javascript:" &
        "$.get('" & 
        $URL & 
        "',setTimeout(function(){" &
        "location.reload(true);" &
        "},2000));" 
        & "void(0);"




        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------