Iterator Step - How to Pass values to child workflow?

Hello,
I am using sql row iterator in parent workflow with values need to be passed to child workflow called in Iterator step. I am trying o pass value to worklfow which uses dqc plan with sql execute step and let me know if there is an example with similar scenario.

Thanks
Siva

Hello Siva,

you can use Random Record Generator component.
with this component you can map your input variable.
after that in your sql call your variable like that ${variable}

Regards

Hello Siva,

The solution depends on your use case, but apart from the option provided by Dimitri, you can consider using Workflow variables. This is the best practice on how to pass value from one workflow to another. You can use variables to pass the information to other tasks, store and pass the information read by other tasks or pass the information outside the current task.

To define a variable in the workflow go to Global properties by right-clicking on canvas and choose tab Variables. We have two types of variables used there derived and input.
image image

The simplest example which comes to my mind is that you can read from the column using Iterator with SQL row Iterator implementation and pass this value to a child workflow where you can run a component and use the values for a file name for example.

Kind regards,
Mario

My option is just to pass a variable to “sql execute” or “sql select” component.
Between workflows Mario’s solution is the best

I tried using the solution proposed with global workflow properties in my usecase and still having trouble in passing value from parent o child workflow. please check on the attachment and let me know if am missing anything from the proposed solution to make it work.

Thanks
SivaIterate_Step_Issue.zip (3.5 KB)

Hello Siva,

Thank you for sending the files, now it is much easier to understand what the issue could be. I have found out that you are using a plan instead of a component. In order to use parameterizing, you should use component. In addition, in your solution, you are missing to define a parameter in the child workflow.

When you make your component please don’t forget to parametrize the column which you are going to use.


Kind regards,

Mario

I made it as component and still not getting value passed to child wf.Iterate_Comp.zip (2.3 KB)

Hello Siva,

Thank you for sending the files.

Please note that in workflow you should define parameter as well. In Configuration tab of the Run DQC task, there is a definition for parameters that you can pass to the component. You have to define the required parameter there in order to be passed to the component.


In addition, in the Run DQC you are still calling the plan not the component.

Kind regards,

Mario

Thanks Mario for the screenshot and explanation,got it to work .

Thanks
Siva