Forum Discussion
Issue with ForEach Activity in an IF Activity
- Anonymous2 years ago
Hi agustingp ,
For the elements of the operation you mentioned in step 1, I think you can compare the data between the source and data warehouse tables to determine which rows need to be updated, inserted, or deleted.
Use the Set Variable activity to store the number of rows returned from the previous step.
Add the If Condition activity to check if the variable (number of rows) is greater than 100.
The procedure is shown below:
Get the rows to change → 2. Set the variable to → 3. If Condition:
Facts:
Erase the table
Copy the data
Fallacy:
ForEach loop
Find Activity
This approach should help avoid misleading "run failed" statuses and make the pipeline more efficient and easier to manage.Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 2 years ago
Pipelines make you think a little differently. For this, I would setup a second pipeline that has the For Loop. And change your "dummy IF" into a normal IF. Inside of the False section, make it run the second pipeline with the For Loop.
You should be able to pass values using the pipeline Parameters.
It's likely those 3 activities after your For Loop would go in to the pipeline for the For Loop.
Pipelines make you think a little differently. For this, I would setup a second pipeline that has the For Loop. And change your "dummy IF" into a normal IF. Inside of the False section, make it run the second pipeline with the For Loop.
You should be able to pass values using the pipeline Parameters.
It's likely those 3 activities after your For Loop would go in to the pipeline for the For Loop.