All posts

Map nested JSON and XML by dragging

Building an order document with line items used to mean writing a loop. Two kinds of lookup replace the JavaScript.

Flat-to-flat mapping is solved in every tool on the market. Drag a column, drop it on another column, done.

Nested is where tools separate. The moment you need an order document with an array of line items, or a supplier feed where each record contains a repeating block, most platforms hand you a scripting window. From there the mapping is code, one person understands it, and it has stopped being a mapping.

The shape of the problem

Producing nested output raises a question flat mapping never asks: where does the array come from?

Your source is usually relational. Orders in one table, line items in another. The output needs one object per order with its items inline. Something has to run a query per order, collect the rows, and emit them as an array at the right point in the document. Traditionally that something was JavaScript you wrote.

Parsing nested input has the same problem inverted. One document flattens into several related record sets, and the relationship between the header and the repeating block has to be expressed somewhere.

Two kinds of lookup

Version 9.6.4 added the Lookup Builder, our point-and-click expression builder. It produces two kinds of result, and that distinction is the entire idea.

Single value returns one column from one matching row. The VLOOKUP equivalent. Use it to pull a customer name onto an order line, or a currency code from a reference table.

DataSet returns a result set. This is what populates a nested-mapping loop or a repeating X12 segment. One source row drives many output elements.

Single value handles enrichment. DataSet handles repetition. Between them they cover the cases that previously required a loop, and both are configured in the UI.

It works in all three editors

The Lookup Builder is available in the flat mapping editor, the nested mapping editor, and the X12 Message Designer, our schema-driven editor for building EDI messages.

That consistency is the point. Learning how DataSet lookups work while building a JSON document means you already know how to populate a repeating loop in an X12 850, because it is the same mechanism.

Nested mapping handles JSON and XML in both directions and to arbitrary depth. Build a document from flat sources, parse a document into flat destinations, or map nested to nested when the two structures disagree.

Where AI fits

Simba, our AI agent, can write the mapping for you. Open the chat from any mapping editor, describe what you want in plain language, iterate, and tell it to apply. The result lands in the editor as a draft you review and save.

That is faster for a first pass, especially on a wide source where the tedious part is matching seventy field names. It does not replace understanding the mapping, and the draft-then-save flow is deliberate. You look at what it built before it becomes real.

Where code still belongs

Some transformations want code, and pretending otherwise wastes your afternoon. Conditional logic depending on three fields and external state. Custom parsing of a field that contains its own encoded structure. A numeric algorithm with rounding rules from a compliance document.

Those are code, and JavaScript, Python, and SQL are all available inline. What changed is that "I need an array here" no longer puts you in that category.

Try it on your own data.

14 days, no card. Point Etlworks at a real source and see what it does.