< Back
Print

Loops explained

Loops can be used to Iterate over a collection of values such as entries in a price table, a multiselect CS-attribute or child objects.
A loop is always made up of a loop head and one or more loop values.

Loop Head

Basic Info

Use Cases

  • exporting pictures contained in a multiselect mam-reference
  • exporting all contained product-ids of a category
  • exporting values from stock or price tables

Input

The required input can vary, depending on the selected loop context in the configuration.
In most cases a loop will require a multiselect CS-attribute or an Item (Product, Mamfile, View) which correspond to the desired values.

Output

(Array) A loop will create an array containing the transformed values

Configuration

To use a loop, start by selecting the loop head plugin.

After selecting the plugin, open it’s settings by clicking on the gear icon next to the selection.

Loop Context

The loop context provides a special plugin interface for different types of values.
Choose the plugin based on the kind of values you want to traverse.

Each loop context also has it’s own settings to further configure which values you want to use.
Selecting only the values you actually use in your transformation can increase performance.

Label Description
Unique Name The Name is used to identify the loop in the loop value plugin.
We recommend choosing a descriptive name so you can remember what the loop does.
Format the source The selected plugin will be used once for every value in your selected context (e.g. for each child). For a basic loop you can select the loop value plugin.
Start with element n If you want to start iterating on the second or third element of your context you can use this field.
You can also reverse the direction of iteration by using a negative number.
Number of Elements to be returned You can use this option to limit the amount of iterations.
This can be useful if you have a lot of prictures but only want to export a maximum of 3 per product.

Loop Value

Basic Info

Input

(None)

Output

(Int|Float|String) A single value of an active loop

Configuration


Label Description
Loop Context This is a list of available loop heads. The loops will be shown with their previously assigned unique name.
Source Field Here you can select which of the available values you want to output.
The available values are configured in the loop context plugin setting which can be accessed in the loop head.
Formatting Here you can select which plugin to use for loading the value.
If you don’t want any further transformations, you can use “CS formatted value” or “CS unformatted value”.
Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents