This guide explains common mapping behaviors and answers frequent customer questions in a clear, practical format.
- How to use if and return in mappings.
- Record-level links: At the record level, the return value controls the entire record and its child element links.
Example mapping path: /Document/Implicit/DTL_LoopPO1 => /Document/FGrp/Msg/LoopPO1 - If the record link returns a literal value such as "abc", that text becomes the content of the XML node.
For non-XML outputs (fixed-length, delimited, CSV, EDI), this may cause invalid output or parser errors.
Because of that, we usually return an empty string ("") at record level when we only want the node structure. - Using skip() at record level skips the entire record, including all child links, regardless of child-level code.
This is useful when a business condition means the whole group should not be generated. - Element-level links:
At element level, behavior is simpler: return the final value for that single element.
You can map directly with no code, or add lightweight logic and return a computed value.
- Record-level links: At the record level, the return value controls the entire record and its child element links.
- Useful helper functions:
Functions like value.IsNullOrEmpty() are commonly used to validate values before mapping. This helps avoid empty or invalid output and keeps transformation logic explicit. - Looping requirements:
A loop always needs a valid source to iterate. Even if custom code exists, the loop will not run correctly without an appropriate source context. - Is C# logic always required?
No. C# logic is optional and should be used only when direct mapping is not enough.Use C# when you need conditional generation, value normalization, or multi-field business rules.
- Different requirements across versions.
There is no functional behavior difference between doctype versions for these mapping rules. However, some maps enable Run Parallel for performance when the number of links is very large.In parallel mode, links at the same level can run before moving to higher levels, so strict execution-order assumptions may break.
As a result, parent/child lookups and get/set value patterns can behave unexpectedly if they rely on sequential execution.
Recommended best practices:
Use skip() at record level only when you intentionally want to remove the entire group.
Prefer return "" at record level for non-XML outputs.
Keep element-level logic focused and easy to test.
Validate mappings in the target output format (XML, CSV, EDI, etc.) before delivery.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article