Hey,
Create a parameter of type String and concatenate your values with a '|' separator
eg: 2018-05-30,2019-01-01|2018-12-31,2020-01-01
Then use Split function on that parameter based on '|' for the number of iterations.
Now within the foreach use split again on item() but on ',' and leverage element [0] and element [1]
please refer the below JSON
{
"name": "pipeline7",
"properties": {
"activities": [
{
"name": "ForEach1",
"type": "ForEach",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"items": {
"value": "@split(pipeline().parameters.Test,'|' )",
"type": "Expression"
},
"isSequential": true,
"activities": [
{
"name": "Wait1",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
},
{
"name": "Set variable1",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "Dummy1",
"value": {
"value": "@split(item(),',')[0]",
"type": "Expression"
}
}
},
{
"name": "Set variable2",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "Dummy2",
"value": {
"value": "@split(item(),',')[1]",
"type": "Expression"
}
}
}
]
}
}
],
"parameters": {
"Test": {
"type": "string",
"defaultValue": "2018-05-30,2019-01-01|2018-12-31,2020-01-01"
}
},
"variables": {
"Dummy1": {
"type": "String"
},
"Dummy2": {
"type": "String"
}
},
"annotations": []
}
}