Forum Discussion
amaaiia
2 years agoSkilled Sharer
Isolated variable inside loop iteration
Is there a way to have a variable that is only affected by one iteration within a loop activity? I mean, I have a variable var1 and it is updated within a loop, but I want that variable to affect onl...
- Anonymous2 years ago
Hi amaaiia
Data Factory pipelines don't directly support loop-specific variables.
Anonymous
2 years agoNot applicable
Hi amaaiia
Thanks for using Fabric Community.
Data Factory pipelines don't directly support loop-specific variables. However, you can try this:
Use Set Variable Activity:
- Inside your loop, include a "Set Variable" activity before your logic that modifies the original
var1. - Within the "Set Variable" activity, define a new variable specific to the iteration.
- Modify this newly created variable within the loop.
This might be helpful in your case. You can refer to this link for more help:
How to create iteration scoped variables inside ForEach activities in Azure Data Factory - Stack Overflow
Hope this helps. Please let me know if you have any further questions.