I am building an Azure Data Factory. Inside a Data Flow I have an array of strings.
That array of strings I wish to merge into one single string.
ie. [ "value1", "value2" ] into "value1, value2"
Is that even possible, I can´t find any function helping me out here?
I wish there existed a join function or foreach but can't find any?
CodePudding user response:
Does toString(myArray) do what you are looking for?
CodePudding user response:
You can use the join function which is present in collection functions in Add dynamic content.
Syntax:
join([<collection>], '<delimiter>')
Example:
join(variables('ARRAY_VARIABLE'), ',')
Refer this to learn more about the Join.
Also, you can do it by using a ForEach loop activity to iterate over the array and use a Set Variable task with a concat expression function to create the comma separated string.
In case, you just have two elements in your array, then you can do like this.
@concat(variables('variable_name')[0].Code1, ',', variables('variable_name')[1].Code1)