Upland OL User community

Transactional data for nested tables using CSV in DataMapper

Is there a way to present transactional data to use for nested tables in the DataMapper using CSV data? The only example I can find in the user guide involves the use of XML, which has different options in the repeat step. Is there a way to essentially replicate the ‘for each’ option present when using XML for CSV data?

Just use the “Until no more elements” to loop through each line in your CSV record.

Of course, that’s assuming you’ve properly set your record boundaries to group CSV lines into related records (which, in most cases, is done by using a “On change” trigger in the boundaries and specifying which field is common to each individual record.)

This gives me a listing for all elements for 1 record, which is fine. What I then need to do is get a listing of elements within the record based on another field in the data. Is this possible?

Yep. The way to do it depends on how your lines are structured within the record.

If all the lines that you want to examine are consecutive within the record, then you can simply use a Repeat Type of “While statement is true” and specify the condition you want to evaluate (for instance, Column Quantity is greater than 0). The loop will stop as soon as it encounters a value of 0 in the column Quantity.

But if the lines that meet your condition can be anywhere in the list of lines, then you’ll have too loop through all lines and inside your Repeat loop, add a condition to check whether the current line meets that specific condition (for instance, Column Quantity is greater than 0). In the Condition’s True branch, add whatever steps you need to process that line. Don’t put anything in the False branch, that way the loop will just skip over it. In this example, all lines whose Quantity field value is 0 would be skipped.