Hi @Rahi Jangle
Welcome to Microsoft Q&A platform and thanks for posting your question here.
Based on your query, it seems like you want to append the string values generated by the first Set Variable activity per iteration without using the Append Variable activity and without using an array type variable.
One way to achieve this is by using a String type variable and concatenating the string values generated by the Set Variable activity in each iteration.
Here's an example of how you can achieve this:
- Create a String type variable, let's call it "outputString".
- Inside the For Each loop, set the value of the "dynamicbody" variable to a new variable, let's call it "iterationOutput".
- Concatenate the "iterationOutput" variable with the "outputString" variable using the expression language in the Set Variable activity. The expression should look like this:
@concat(variables('outputString'), variables('iterationOutput')).
- At the end of the For Each loop, the "outputString" variable will contain the concatenated string values generated by the Set Variable activity in each iteration.
This approach may not be as efficient as using the Append Variable activity with an array type variable, especially if you have a large number of iterations. However, it should work as a workaround if you cannot use the Append Variable activity or an array type variable.
Reference
https://learn.microsoft.com/en-us/azure/data-factory/control-flow-set-variable-activity
https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.