Discussions

Expand all | Collapse all

Solving delay in pipelines

  • 1.  Solving delay in pipelines

    Posted 05-03-2021 09:39
    Is there any way to solve delay in pipeline ?
    Users of our app in a particular step will create records for a trigger in pipeline and then they will have to move next part of the job, where they go to table "xyz". Table "xyz" must be now filled with records as a result of the pipeline I mentioned earlier.  The users are going to work on this newly created record by pipeline.  But sometimes this pipeline do not get triggered very soon after we create trigger record. This delay can lead to additional errors and confusion for users when they check the table "xyz".
    Is there any way to notify users about this delay in execution of pipeline ?

    ------------------------------
    Aswin Babu
    ------------------------------


  • 2.  RE: Solving delay in pipelines

    Posted 05-03-2021 11:39
    Hi Aswin,

    Pipelines make requests of Quickbase while moving around data much like a user does, and as a result there can be some delays if your app is having traffic or if the Pipelines have to run through some complex logic on their own. One trick that can be helpful is to use a code page to create a delay of a few seconds with a message to users to give Pipelines a chance to run and complete. One of our team members here at Quickbase made an article where he walked through how you can use this technique right here. 

    It can also be handy other places you are using integrations like an API call that need time to run their logic. You can give users some feedback and set expectations to remove confusion. I hope this suggestion is helpful Aswin.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quickbase
    ------------------------------



  • 3.  RE: Solving delay in pipelines

    Posted 05-03-2021 16:48
    Thank you i will check it out

    ------------------------------
    Aswin Babu
    ------------------------------



  • 4.  RE: Solving delay in pipelines

    Posted 05-04-2021 05:54
    Hi Evan,
    I tried to replicate steps on the article that you gave me. I was able to make URL field but couldn't figure out where to add javascript. I simply pasted that code into page2.html (page id = 6) which didn't work and then I tried renaming the page to page2.js this too didn't work. 
    Please guide me on how to add these js piece to  an HTML page.

    ------------------------------
    Aswin Babu
    ------------------------------



  • 5.  RE: Solving delay in pipelines

    Posted 05-04-2021 08:58
    Hi Aswin,

    Most likely what you just need to do rather than keep the pageid=6 in the example formula is to look at the page id of the html page you made and substitute your html pages page number for the example in the formula (it might be a different page number in our example because pages are numbered as they are created not by naming them). I have included a screenshot of an example where you will find the page number on your Pages table in your application settings. I hope that helps Aswin



    Here is a help document on how to create code pages

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quickbase
    ------------------------------



  • 6.  RE: Solving delay in pipelines

    Posted 05-04-2021 16:12
    There was already an empty page already with page id =6. What I'm not able to figure out is how to use the javascript code
          let urlParams = new URLSearchParams(window.location.search);
            let url = urlParams.get('url');

            fetch(url, {
                method: 'post',
                mode: 'no-cors',
                headers: { 'Content-type': 'text/plain' }
            }).then((response) => {
                setTimeout(function () {
                        window.location.href = document.referrer}
                   , 2500); // # of milliseconds to pause for, 2500 = 2.5 seconds
            })
    How should I copy this code in the page id=6 . Isnt there a format for writing javascript inside HTML ?
    Please guide me on this

    ------------------------------
    Aswin Babu
    ------------------------------



  • 7.  RE: Solving delay in pipelines

    Posted 05-04-2021 17:33
    Great I just wanted to confirm that wasn't hanging you up. Yes there is more to creating a code page that does it all. You can find a full example of that here in our code page sample app under the code page body field, which you could then tweak to fit your needs. the app itself has a number of examples in it for common code page uses as well.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quickbase
    ------------------------------



  • 8.  RE: Solving delay in pipelines

    Posted 05-05-2021 02:39
    Hi thanks for sharing that. 
    I have created a URL for triggering the pipeline. But its not adding new record in the target table. My formula is given below. 
    var text urlToExecute = URLRoot() & "db/" & "bq8igmr2b" & "?a=API_GenAddRecordForm&_fid_6=" &"Signal";
    URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=6" // Open code page 6
    & "&url=" & URLEncode($urlToExecute) // Pass in the URL to execute​
    Please tell me if there is any error in this formula. It seems fine. it ran properly without using a variable.

    ------------------------------
    Aswin Babu
    ------------------------------



  • 9.  RE: Solving delay in pipelines

    Posted 05-05-2021 10:22
    Hi Aswin,

    Usually you set it up so that the button you push to kick everything off makes the change that triggers the Pipeline (for example checking a run Pipeline field) and then the delay is being run in the code page just to give that Pipeline time to run. I haven't set up one myself that directly calls the Pipeline but someone here in the Community might have and would be able to chime in.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quickbase
    ------------------------------



  • 10.  RE: Solving delay in pipelines

    Posted 05-06-2021 14:06
    Should I post as a new question or will you request someone to reply?

    ------------------------------
    Aswin Babu
    ------------------------------



  • 11.  RE: Solving delay in pipelines

    Posted 05-07-2021 16:08
    This issue is solved.
    I replaced API_GenAddRecordForm with API_AddRecord and added app token too to the URL .
    I hope it helps someone else. 


    ------------------------------
    Aswin Babu
    ------------------------------