Forum Discussion

NickSheetz's avatar
NickSheetz
Qrew Member
3 months ago

Pipeline to Split Record into More Records Based on Field

Hello all! 

I could use some help with a pipeline. I have a table called assets. When the sales team adds assets to an order they enter a quantity. There are times that the operations team then needs to take an asset with a quantity of 4 and split it into 4 separate asset records with a quantity of 1. I need to create a pipeline for this use case. 

I have seen the sample create child pipelines and neither one fits my particular use cases. I was just curious if there were any jinja/pipeline wizards here that could give me a hand. 

Thanks!

Nick

  • There is probably a fancy way way with jinja / regex, I'm a low tech kind of guy, so  I would set up a helper table preloaded with records numbered from one to 100.

    Then, on some kind of trigger, I would search that helper table, looking for records numbered less than the quantity of the trigger record.

    Then a For Each loop to add a child record of more lines to your order.  Then, lastly, I would edit the trigger record to set the quantity down to 1.  

  • There is probably a fancy way way with jinja / regex, I'm a low tech kind of guy, so  I would set up a helper table preloaded with records numbered from one to 100.

    Then, on some kind of trigger, I would search that helper table, looking for records numbered less than the quantity of the trigger record.

    Then a For Each loop to add a child record of more lines to your order.  Then, lastly, I would edit the trigger record to set the quantity down to 1.