CITIES ( 1…N)
- City ( alfa )
CUSTOMERS OF CURRENT CITY (1…N)
- Customer ( alfa )
INOICES OF CURRENT CUSTOMER (1…)
- InvoiceID (alfa )
- Amount ( num )
I Set the boundaries to “ON CHANGE” field City, that’s ok.
Then a loop “until no more elements” to read the customers of the current city. Store in a table CUST_LIST that’s is ok
Inside this loop, another loop “While statement is true” comparing the current customer field with the previous one. In this loop I read the invoice fields InvoiceID, Amount into the table INV_LIST
The goto step is inside the second loop
The first Customer of each record ( CITY ) is ok, but the next ones get mixed values in the “InvoiceID” and “Amount” fields from the first one and the current one. The number of records is ok however
Its look like the INV_LIST table is not initialized on create a new entry
I guess that the problem must be on the goto field.
I have reproduce the behaviour, although my Datamapper is slightly different than yours. I will escalate this to our R&D and get back to you with the answer.
There is unfortunately no workaround, but as @hamelj already mentioned, the problem only occurs while you are designing your data mapping configuration. But if you save your configuration and test it from the Workflow tool, you’ll get the proper results.
It’s a bit of a pain in the butt having to send your DM config to Workflow in order to ensure that it works correctly, but at least it does work.
I add an Action in which I simply define a variable named customerCode (without the keyword var, so it is global) which I set to empty
I loop Until no more element
Inside the loop: I setup a condition that compare the content of the column Customer with the content of the variable customerCode
4.1 If they are different, I extract the Customer which ends-up in the detail table customer
4.2 If they are different, I set the variable customerCode with the current value for the column Customer
I extract the InvoiceID and the Amount and manually enter the name of a nested table after the customer one (as shown in the attached image) and call it other