Array Aggregator - Conditional logic based if output has 0 items, 1 items, or many items

Hi. I have this scenario, where by I am loading a list of unmatched payouts from Airtable. Then, I am trying to match them to another table containing Bank Transactions, based on certain conditions. Depending on how many matches found, I want to do different logic.

  • If 0 matches, mark the payout as unmatched
  • If 1 match, mark the payout as matched, and link to the matched transaction
  • If >1, save a list of IDs in a field, so it can be matched manually.

When I use an Text Aggregator, it seems to be passing always from one route.

I also lose the ability to check for the bundles.length after the aggregator. Any advice on how this an be done?

@karlcassar when using an aggregator the aggregator module will alsways be reached (even if there are no bundles to aggregate)
2 possible fixes

  1. check the box to ‘stop after empty aggregation’ this will sssentially stop the route if there is no data to process in the text aggregator.

  2. you could set a filter to check for ‘null’ value on the output from the text aggregator and not allow the scenario to continue.

The easy way is method #1 but sometimes option 2 works better if you still need to do other things in the scenario.

Hope that solves your issue.

3 Likes