Discussions

 View Only
  • 1.  Variable assignment in Pipelines

    Posted 02-26-2021 09:04
    Does anyone have experience with assigning a variable in Pipelines and changing it throughout the pipeline.

    Basically, I want to assign a variable at the start of the 'for' loop and then increment it by 1 for each part of the loop.  Has anyone done this?

    ------------------------------
    Jessica Feauto
    ------------------------------


  • 2.  RE: Variable assignment in Pipelines

    Posted 02-26-2021 09:50
    No,  but I'm working with Quickbase support hoping that they will engage a senior person to work with me on this similar Pipelines issue here.  In will post back there if I find a solution.


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



  • 3.  RE: Variable assignment in Pipelines

    Posted 02-26-2021 11:03
    Thanks Mark!  I saw your post after I posted mine.  The fact that they run for-each loops asynchronously is really a problem for my use case as well.   I've tried chaining Pipelines (ie pipeline 1 performs an action then cues pipeline 2) together to get them to run in sequence but that didn't work either.

    I sent a support request for Quickbase 2 days ago about this but they have not gotten a solution for me yet.   I'll keep you in the loop (pun intended).

    ------------------------------
    Jessica Feauto
    ------------------------------



  • 4.  RE: Variable assignment in Pipelines

    Posted 03-10-2021 14:00
    Jessica, Have you gotten a solution for this yet?

    ------------------------------
    Ursula
    ------------------------------



  • 5.  RE: Variable assignment in Pipelines

    Posted 03-06-2021 03:28
    Jessica,
    I have not tried to do this exact variable (increment by 1) but you may be able to use the 'loop.index' variable to add the increment in each loop as this will increment by 1 each time through.  I'm not sure if the syntax is correct but you could try something like {% set Variable = {"value" : "[your variable] + loop.index"} %} inside the 'for' loop.  Then to user the variable is just {{Variable.value}}...  I have used similar to set a field from an outer loop as a variable that can then be used in each inner loop to get child data for each parent record in a single request body.
    Cheers,

    ------------------------------
    Roger Dartnell
    ------------------------------



  • 6.  RE: Variable assignment in Pipelines

    Posted 02-15-2023 12:30

    Hey Roger,

    Do you know if it's possible to use this loop.index solution to create x number of child records based off of a numeric value on the trigger record?

    Where would you add this {% set Variable = {"value" : "[your variable] + loop.index"} %} jinja in the pipeline? As a value that you're mapping in?



    ------------------------------
    Hannah Wright
    ------------------------------



  • 7.  RE: Variable assignment in Pipelines

    Posted 03-16-2023 12:11

    Overall, the need for a Pipeline-scoped global variable would be obvious.  I am trying to set a "running total" variable so I can tally a total for each loop and stop looping when my running total reaches a desired value.

    I don't really want to do this by creating a special field in the table and updating that field within my loop, but I will if that's the only way I can figure out.