You are here:
Create a Loop Block Example That Adds Values to List Items Using Conditions (Managed Package)
For the managed package runtime, an Integration Procedure adds a dynamic value to each item in a list using conditions. Although dynamic in the list, the values are hard-coded in the Integration Procedure. Use this approach if you know or care about a specific set of possible values.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
The input looks like this, with uservalue values
initially set to null. The uservalue nodes don't have to be included in the input,
but it's easier to compare input to output if they are.
{
"Labels": {
"OfferType": "Remediation",
"BillingCycle": "Immediate"
},
"productAttributes": {
"records": [
{
"record": {
"uservalue": null,
"label": "BillingCycle"
}
},
{
"record": {
"uservalue": null,
"label": "OfferType"
}
}
]
}
}The output looks like this, with uservalue values
set according to the label value in each list
item.
{
"Labels": {
"OfferType": "Remediation",
"BillingCycle": "Immediate"
},
"productAttributes": {
"records": [
{
"record": {
"uservalue": "Immediate",
"label": "BillingCycle"
}
},
{
"record": {
"uservalue": "Remediation",
"label": "OfferType"
}
}
]
}
}The Integration Procedure has these components:
-
A Loop Block, named LoopBlock1
-
A Set Values component within the Loop Block, named SetValues1
-
A second Set Values component within the Loop Block, named SetValues3
-
A Set Values component after the Loop Block, named SetValues2
-
A Response Action, named ResponseAction1
The Structure panel looks like this:

To build this Integration Procedure:
- From the Omnistudio Integration Procedures tab, click New.
- Provide a unique Integration Procedure Name, a Type that can be a category, and a unique SubType, then click Save. You only have to save this one time.
-
Drag a Loop Block into the Structure panel and give it the following settings:
Property
Description
Loop List
Set this value to
productAttributes:records.Additional Loop Output
Click Add Key/Value Pair. Set the key to
productAttributesand the value to%productAttributes%. -
Drag a Set Values component into the Loop Block and give it the following settings:
Property
Description
Element Name
Name this element
IfOfferType.Element Value Map, Element Name
Click Add New Value and assign an Element Name of
LabelValue.Element Value Map, Value
Assign a Value of
=%Labels:OfferType%.Response JSON Path
Expand Response Transformations and set this value to
LabelValue.Response JSON Node
Set this value to
productAttributes:records:record:uservalue.Execution Conditional Formula
Set this value to
productAttributes:records:record:label == "OfferType". -
Drag a second Set Values component into the Loop Block and give it the following
settings:
Property
Description
Element Name
Name this element
IfBillingCycle.Element Value Map, Element Name
Click Add New Value and assign an Element Name of
LabelValue2.Element Value Map, Value
Assign a Value of
=%Labels:BillingCycle%.Response JSON Path
Expand Response Transformations and set this value to
LabelValue2.Response JSON Node
Set this value to
productAttributes:records:record:uservalue.Execution Conditional Formula
Set this value to
productAttributes:records:record:label == "BillingCycle". -
Drag a Set Values component below the Loop Block and give it the following settings:
Property
Description
Element Name
Name this element
AssembleOutput.Element Value Map, Element Name
Click Add New Value and assign an Element Name of
productAttributes.Element Value Map, Value
Assign a Value of
%LoopBlock1:productAttributes%.Element Value Map, Element Name
Click Add New Value again and assign an Element Name of
Labels.Element Value Map, Value
Assign a Value of
%Labels%. -
Drag a Response Action below the last Set Values component and set its
Send JSON Path property to
AssembleOutput. - Go to the Preview tab and click Edit as JSON.
-
Copy this JSON data and paste it into the Input Parameters panel:
{ "Labels": { "OfferType": "Remediation", "BillingCycle": "Immediate" }, "productAttributes": { "records": [ { "record": { "uservalue": null, "label": "BillingCycle" } }, { "record": { "uservalue": null, "label": "OfferType" } } ] } } -
Click Execute. If you built the Integration Procedure
correctly, the output looks something like this:
{ "Labels": { "OfferType": "Remediation", "BillingCycle": "Immediate" }, "productAttributes": { "records": [ { "record": { "uservalue": "Immediate", "label": "BillingCycle" } }, { "record": { "uservalue": "Remediation", "label": "OfferType" } } ] } }To correct a component, click it in the Structure panel and edit its properties.

