Discussions

 View Only
Expand all | Collapse all

Conditional formula-URL fields

  • 1.  Conditional formula-URL fields

    Posted 12-31-2020 17:32
    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([Trigger],
    $setCheckBox & "&rdr=" & $reDirect,
    $reDirect
    )

    ------------------------------
    Paul Streit
    ------------------------------


  • 2.  RE: Conditional formula-URL fields

    Posted 12-31-2020 17:46
    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
    ------------------------------



  • 3.  RE: Conditional formula-URL fields

    Posted 12-31-2020 18:00
    Thank you, you answered the question and I’ll use an automation.

    Regards
    Paul




  • 4.  RE: Conditional formula-URL fields

    Posted 12-31-2020 20:16
    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




  • 5.  RE: Conditional formula-URL fields

    Posted 12-31-2020 21:04
    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
    ------------------------------



  • 6.  RE: Conditional formula-URL fields

    Posted 12-31-2020 21:47
    Thank you, will try it. Like everyone else stuck at home sheltering in place instead of going to parties. Sigh...

    But happy new year!

    Paul





  • 7.  RE: Conditional formula-URL fields

    Posted 01-01-2021 18:05
    Mark,

    Can the slow refresh code be easily changed for a compound URL instead of a single URL? If so, how would that work?

    Happy New Year!
    Paul




  • 8.  RE: Conditional formula-URL fields

    Posted 01-01-2021 18:31
    No, that syntax only works with a single URL with no redirects. What are the URLs doing that you need executed and do they need to be executed in sequence?

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



  • 9.  RE: Conditional formula-URL fields

    Posted 01-01-2021 18:34
    There is another syntax that might work but the URLs won't execute in sequence.

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



  • 10.  RE: Conditional formula-URL fields

    Posted 01-01-2021 19:27
    Some are in sequence. I made as many as I could in parallel but the automations still take more time to execute than the formula-URL code so the changes are not reflected in the report being displayed.

    I may have a another solution that I will try tomorrow and will report back.

    Thanks
    Paul