Variable in workflow | Looping through input data and store the computed data into a variable and then remove it from input data - Return the variable at the end

kindly help me, I’m new to n8n and need some assistance with my current workflow setup.

Use Case

I have two lists:

  1. Expenses: A list of expense items.
  2. Transactions: A list of transaction items.

Goal

I want to match each expense with a transaction. Specifically, I need to:

  1. Loop through each expense.
  2. For each expense, loop through the transactions to find a match.
  3. When a match is found, remove the matched expense and the corresponding transaction from their respective lists to prevent duplicates in the next iterations.
  4. Store the matched data temporarily.
  5. Return the final results after all matches are processed.

Problem

I’m struggling to find a way to store temporary data for the matched expenses and transactions and to properly remove matched items from the lists. Could someone guide me on how to achieve this in n8n?

Details About Environment.

Using cloud N8N , Database is on bubble , i am sending the data from bubble api to n8n webhook triggering it.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

just updated my post. with below section:

Details About Environment.

Using cloud N8N , Database is on bubble , i am sending the data from bubble api to n8n webhook triggering it.

hello @baloshi69

You can do it with something like this

2 Likes

From where you get the start node, i cant see it. i am on cloud N8N using trial.

Keep in mind that if you are going to delete items from the list based on their position (like in Google/MS Sheets), then you’ll have to reverse their order before deletion. Otherwise after the first deletion the positions of the rest items will change.

@barn4k Okey, Its an array of object, so i am iteratign on object, and probably deletign one , on each loop.

so you want me to before deleting the item i revers the array and delete the last item and then revers them again.

i can do that, but currently i cant find the START or NEXT node . i dont know why.

It’s called No Operation Node and uses as placeholders or to build correct arrows without overlapping

1 Like