How to copy the output of workflow 1 in to workflow2

Hi Team,

I have a scenario to copy the result(Output-Its in string) of workflow 1 in to workflow 2.
Scenario:
Workflow 1 Name:Agents(Output-Failed Agents)
Workflow 2 Name:Policies(Output-Failed Policies)

Expected:
Email need to be send with both outputs.From Workflow 2 am sending email copying the Workflow 1 output.
Appreciate your inputs!

1 Like

Hi @RajeshT

To send the data from workflow 1 to workflow 2,
You need to declare out_agument in workflow 1.
And invoke the workflow 1 in workflow 2, while invoking you need to import the argument, store the argument value into the variable.
Now your variable will contain the workflow 1 data, and you can use it appropriately.

1 Like

Thank you for your response @sharique.khan .
I understand declare out_agument in workflow 1 as below:


How to invoke workflow 1 in workflow2,could you please provide on example!

1 Like

@RajeshT

Here is link, on how to use arguments with example.
https://docs.uipath.com/studio/docs/using-arguments

Mark it as solution,if it helped you.

1 Like

@RajeshT

In the workflow 2, use Invoke WorkFlow Activity and provide workflow 1 path to invoke that.

And also in Workflow 1, create one argument and mention direction as Out and pass that value to WorkFlow 2 and here also create argument of same type and mention direction as In to accept value from other workflow 1.

1 Like

Hi @lakshman,

Workflow 1 I have given as below:

In Workflow 2 ,I mentioned as below:

Arguments as :slight_smile:

Using if condition sending email as below:

image

Getting error as:
If condition,object reference is not set.

1 Like

@RajeshT

Click on Import Arguments of workflow 1 and show me screenshot once. I guess you didn’t pass that argument value.

1 Like

Here it is:

@RajeshT

In the value field pass the variable.
Then use that variable

1 Like

Hi @sharique.khan @lakshman

Which variable i need to key in?

@RajeshT

Here value is empty. Create one variable of string and pass it here. And then pass this variable to other workflow where you created In argument in other workflow.

5 Likes

@RajeshT

It should be of same type i.e String

5 Likes

Hi @lakshman @sharique.khan

Is this correct?

@RajeshT

Nope, FinalOutput should be variable of type string, not argument.

3 Likes

@RajeshT

No. It should be variable of type string but not argument and you have to pass this variable to other argument in the workflow 2.

1 Like

@sharique.khan @lakshman
I am bit confused ,appreciateAgent_LIC_TRAIN_ Validation_Production.xaml (98.4 KB) if you could changes in workflow.