< Back
Print

Loop Head and Loop Value

Introduction

The “Loop head” format must be used together with the “Loop value” Format Plugin.
The configuration begins by selecting the “Loop head” format plugin and specifying a “Loop context”.
Values from the loop can then be accessed using the “Loop value” format. The values that are available depend on and are defined by the selected Loop context.
Screenshot selecting Loop head format plugin

 

Configuring the “Loop head”

There are 5 input fields that you can configure which will be explained in the following.
Screenshot of the Loop Head configuration
 

Loop context

The context defines which values are accessible through the loop. Also, there is defined over which values is looped. We provide documentation for these contexts.

Plugin Short description Documentation
Loop for single data record This plugin will send a specific value of the state, workflow, valuerange, valuerangetype or tag object. Click here 📖
Loop for attribute references This plugin will send a specific value (configured by using the param field) of the reference value. Click here 📖
Loop for channel references (Views) This format sends a specific value of channel reference. Click here 📖
Loop for DAM references This plugin will send a specific value (configured by using the param field) of the DAM reference.
This param is only available for refernce attributes types
Click here 📖
Loop for PIM references This plugin will send a specific value (configured by using the param field) of the PIM reference.
This param is only available for reference attributes types.
Click here 📖
Loop for user references This plugin will send a specific value (configured by using the param field) of the user reference.
This param is only available for reference attributes types.
Click here 📖
Loop for child elements With the plugin “Loop for child elements” you can send specific values of direct children. Click here 📖
Loop for JSON Objects This format creates a loop over JSON objects. This allows individual values to be extracted from these objects and processed further, similar to all loop values. This format works with both JSON strings and arrays. It is perfect for processing queried data from web APIs. Click here 📖
Loop for parent elements With the plugin “Loop for parent elements” you can send specific values of direct parents.
Different types of records can be selected: Products (CSPIM), Channels (CSView), Files (CSMam), Users (CSUser)
Loop for child elements With the plugin “Loop for child elements” you can send specific values of direct children.
Different types of records can be selected: Products (CSPIM), Channels (CSView), Files (CSMam), Users (CSUser)
Click here 📖
Loop for several attributes With the plugin “SC::Complex-Export multiple values simultaneously” you can define a variety of attributes to be considered for a dynamic count of the target key. Click here 📖
Loop for Complex Articles With the plugin “Loop for Complex Articles” you can send specific values from the SC::Complex article table. Click here 📖
Loop for CS tables This format expects a Contentserv table as its source value and exports attribute values from it. Click here 📖
Loop for Prices With the plugin ‘Send price from SC::Pricetable’ you can send specific price values from the SC::Price table. Click here 📖
Loop for Sales Channels With the plugin ‘Send value of the SC::Vertriebskanal table’ you can send specific cannel values from the SC::SChannel table.
Loop for Stock This plugin sends stock values from the SC::Stock table Click here 📖
Loop for several values (of selection attributes) The plugin “Format several values (for selection attributes)” can export different values from value lists (e.g. the unformatted value). Also, you can customize the export in the extended settings.
Loop for the properties of valuerange entries Requires a ValueRangeTypeID as entry value and reads all options of a valuerange. Every value receives the translated value of the list. Possibly the plugin must be set explicitly to “Export language dependently” to ensure the export of all languages.

 

Unique name of the loop

Each configured loop has a unique name within the current context. You can configure multiple loops in a single datamap row by using “Format of the result value”, or by looping over values that were extracted with the first loop.
In the “Loop values” plugin, you need to select the loop from which you want to retrieve the value.
 

Start with the element n for multi-references

You can start looping over values from an element other than the first one. In this case, 0 and 1 have the same effect. To start from the second element, you must enter 2. (This behavior differs from array indexing in programming languages, where the first element is typically 0 and the second element is 1.)
You can set the value to -1 to reverse the loop order.
 

Number of processed elements

You can set a value of how many loops are executed
 

Configuring “Loop Value”

The “Loop Value” plugin allows you to access loop values while looping over your attribute. There is no other way to access these values.
In the “Loop Value” format, you must configure three values, which are explained in the following section. All three values are required.
Screenshot loop value configuration fields
 

Loop context

This is a dropdown selection where you need to choose the loop by its unique name. The other settings will only appear once the context has been selected, because the next configuration field, “Source field of the particular loop value” depends on the selected loop context configuration.
 

Source field of the particular loop value

This dropdown contains the values available from the loop. The “Loop run counter” is always accessible and returns the current loop count. All other fields must first be configured in “Loop head” → “Loop context”.
In the following example, the context is “Loop for DAM references”, with “FileName” selected as the accessible value.
Screenshot selecting the source value of the loop
 

Formatting of the particular loop value

Here you can process the current value from the loop. This means you can select another format plugin, and the value will be processed further.
For example, you can create a second loop or create an array using multiple key–value pairs. It is also possible to extract multiple attributes at once by using an array. An example is provided below.
 

Example

Exporting DAM-references of a product
In this example we will export the “DAM-File Id” together with the “FileName”.
This is the attribute on a product:
Example DAM Image Loop export product attribute structure
 

Configuring the Loop head
Screenshot configuring loop head for DAM Export Example
 

Configuring the Loop context
Screenshot of configuring the loop context
 

Creating the array
In here you can select the value of each loop with the format “Loop value”
Configuring the Array for the DAM Image loop export example
 

The export looks like this
DAM Export loop example result 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