Handling Conditional Branches
Often times you require in a mapping to execute a part of the mapping only is a specific condition is met. Anveo EDI Connect offers multiple ways to conditionally execute parts of a mapping.
Depending on the situation there are multiple ways to execute parts of a mapping depending on a condition. You can use a mapping line with the property
Type set to Conditional. This allows you to select any function inside the module and only if that function return True the children are executed. This is especially useful with the object COMPARE and provided functions, to compare two values. You can learn more on the available function in the section build-in functions.
If you’re on an import mapping and you want to import a part only if it is present in the data, you’ll often times use a loop and filters on the children to only enter the loop, if the filters match. You’ll learn more about this in the documentation of each converter.
If you’re on an export mapping, some converters offer a Conditional Output property, to only output data based on a specified criteria.
Another way to execute parts of the mapping only depending on data, is to use a table instance and filters, so that the children are only executed, if a record is found.