Discussions

Expand all | Collapse all

Page Refresh to fast for automation

  • 1.  Page Refresh to fast for automation

    Posted 01-17-2020 09:33
    I am experiencing an issue where I saved a record and due to the adding or modifying the record, an automation kicks in and runs. However, the page refreshes to quickly when using the save button and so the changes made by the automation are not visible. I have to manually refresh the page to see them. Some are embedded reports, others are just on the main form.

    I was reading a recent post which I thought described the same thing.

    Auto refresh after saving?

    The post goes on to speak about AJAX, and there is even a link explaining it.

    QB AJAX

    However, after reading through the article, it is mainly focused on embedded reports, which would help to some degree with some of my automations, but not for all of them.

    The first link above also provides some code for a custom page (which I don't currently utilize), or a custom button.

    I thought about using a custom button, but then I would have to hide the green save buttons, and I think that it is getting more complicated than I would like, just to refresh a page so the results of the automation appear.

    Any thoughts on how I might accomplish having the page refresh after a submission via the default save buttons and show the automation results?

    ------------------------------
    Andrew
    andrew.fry25@gmail.com
    ------------------------------


  • 2.  RE: Page Refresh to fast for automation

    Posted 01-17-2020 12:52
    Edited by Evan Westbrook 01-17-2020 12:53
    Andrew,

    I don't have a solution for you, but maybe I can help you frame your hunt for a solution.

    When a button is clicked in a web page, it often sends some sort of API Call. This is typically in the form of an HTTP request. What this means is that when a button is clicked, it sends a message to a server and says "do the thing." This request can have many responses from the server. For example:
    • I did the thing
    • I asked the server if I could do the thing and it wouldn't let me
    • I don't understand what you said
    • Here's the data you asked for with the thing
    • No response

    Quickbase Automations are an easy way to make a "to do" list of multiple API Calls to process sequentially when an Automation receives a request to "do the thing." In Quickbase Automations, when a record is saved, Quickbase asks itself "do I need to do any things." If the answer is "yes," Quickbase sends a request to the Automation saying "do the thing." All of this comes back to your original issue since QuickBase Automations don't give a response after successfully "doing the thing."

    Your examples reference code or special buttons because a common way to code your use case would be:
    • Perform action --> API call --> Wait for response --> Do next step
    • Click Button --> Make API call --> On successful response --> Refresh page

    The limit of Automations in this case are that you don't have the "wait for response" stage. The Automation receives the request to "do the thing" and you trust it to "do the thing" successfully.

    Does your Automation only have one step? If so, you could embed the process above in a formula URL or formula rich text button by using QuickBase's API instead of Automations (Automations are just a nice UI to make QuickBase API calls).

    I hope this gets you closer to your solution. Let me know if you have any additional questions.

    Thanks,
    ------------------------------
    Evan Westbrook
    PRIME Developer
    Harder Mechanical Contractors Inc.
    Portland OR
    ------------------------------