Nested loops with variables shared between iterations

Hello everyone, I’m quite beginner at Kinme or, at least, using these components.

This is a simplified example of my actual requirements, but if I get how those logics work I guess I will be able to apply the same to the real scenario.

Let’s pretend to have 2 different tables:

The first one has the field “Document Number” as key and a string:

The second one has several lines per each “Document Number”; each row reports the changes to be performed in the string of the first table.

I thought to create

  • a first loop that processes each row of the first table, creating a variable with the string and selecting the rows of the second table relevant for this iteration;

  • a nested loop that should apply the changes to the variable as per the instructions provided by the second table.

At each iteration the changes are applied to the variable, but everything disappear once the loop ended.

I read the several discussions already opened on this same topic and I am sorry if I am asking something already clarified to other users, but I struggle in understanding how I should store the final target string in the variable/table row to be used for being exported in an excel file.

Here you go the workflow created for testing purposes.

I really hope that somebody could provide me the key suggestion to get this done.

Thank you for your support.

Giuseppe

Loop_Test.knwf