Forum Discussion

DanielDabek2's avatar
Qrew Member
3 years ago

Current Count of Pipeline Loop

Does anyone have a way to write the current count of a Pipeline Loop to an output field?  Instead of the total loop count {{ a | count }}, I am trying to write the row that I'm on while looping through a CSV.

Perhaps there is a way to index the current row from the row list? 

Daniel Dabek

2 Replies

  • I think I have the same challenge ...

    I have a pipeline to split text in a field using regex (in the example below using *) and create a record for each element that is found. I want to populate both a 'Step' field (with the text produced by the regex) and a 'Sequence ID' field (which starts at 1 and increments for each subsequent record). So, for:
    * Test step A * Test step B * Test step C
    I want to create these 3 records:
    Sequence ID Step
    1                    Test step A
    2                    Test step B
    3                    Test step C
    My pipeline populates the Step field correctly, but I cannot find a simple way to populate the Sequence ID. I had thought I could use the index in the loop that is being executed, but I'm guessing loop.index is only accessible in a loop that has been created using Jinja. I need Sequence ID to be editable after it has been populated in the pipeline, so cannot use a formula query to populate it. Is there a simple solution I can apply in the pipeline?

    Jeremy Anson