The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
As you can see in the image, inside the red box on the right, these are the types of values I would like to insert into the data warehouse. I retrieve these values from a ForEach loop containing a variable. As you can guess, I would like to insert all the data from the variable into the data warehouse.
Thank's you for your help.
JK
Solved! Go to Solution.
Hello @jkrumb ,
Thank you for reaching out to Microsoft fabric community form.
To insert values from a ForEach loop into a Data Warehouse within Microsoft Fabric, you can use the ForEach activity to iterate over your array or list of items. Inside the loop, add a Copy Data or Stored Procedure activity that handles the insertion logic.
You can reference each item dynamically using the @item().propertyName expression, which allows you to pass values from the current iteration into your sink (e.g., a Warehouse table).
For reliable execution, especially when dealing with insertions or variables, it's recommended to set the loop mode to sequential, as variables and some operations are not thread-safe in parallel mode. If you require more advanced logic (e.g., dynamic SQL), consider using the Script activity within the loop.
For more details, refer to the official Microsoft Fabric documentation on ForEach activity, which outlines usage patterns and best practices.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi @jkrumb ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @jkrumb ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hello @jkrumb ,
Thank you for reaching out to Microsoft fabric community form.
To insert values from a ForEach loop into a Data Warehouse within Microsoft Fabric, you can use the ForEach activity to iterate over your array or list of items. Inside the loop, add a Copy Data or Stored Procedure activity that handles the insertion logic.
You can reference each item dynamically using the @item().propertyName expression, which allows you to pass values from the current iteration into your sink (e.g., a Warehouse table).
For reliable execution, especially when dealing with insertions or variables, it's recommended to set the loop mode to sequential, as variables and some operations are not thread-safe in parallel mode. If you require more advanced logic (e.g., dynamic SQL), consider using the Script activity within the loop.
For more details, refer to the official Microsoft Fabric documentation on ForEach activity, which outlines usage patterns and best practices.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi @jkrumb ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @jkrumb ,
To insert values from a ForEach loop into your Data Warehouse, you can follow this approach:
If your variable is an array of objects, each iteration will handle one object. You can also use a Script activity if you need more control over the insert logic (like using dynamic SQL)
Let me know if you need help with the exact pipeline setup
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Thank's,
My value var2 :
Thank's you ?
User | Count |
---|---|
20 | |
18 | |
6 | |
2 | |
2 |
User | Count |
---|---|
49 | |
47 | |
18 | |
7 | |
6 |