Now, we will go back to the Main workflow and invoke the customer information lookup workflow that we created in the previous section. Let's start by creating a variable that we'll use to store the company data:
- In the Main.xaml file, create a new data table variable, call it dtCompanyData, and set its scope to Main Sequence. Let's also set the default values for both dtCompanyList and dtCompanyData to New System.Data.DataTable, as shown in the following screenshot:
- Now that we have the variable, let's add a new Sequence below the Customer List Sequence called Request Customer details Sequence and add the Invoke Workflow file activity. Point the activity to RequestCustomerDetails.xaml, click on Import arguments, and map the arguments to the respective input and output data table variables, as shown in the following screenshot:
- To test what we have so far, let's add a message box under Invoke Workflow and add dtCompanyData.Rows.Count as our message, as shown in the following screenshot:
This will help us understand whether the output data tables have been populated and how many rows there are.
Now, let's run a test for the Automation we have so far. From the Main.xaml file, go ahead and run the Automation. You should receive a message with the count set to 3. This means the company details for all three companies have been extracted.
Now that we have the company information within the Main workflow, let's use that data and update the CRM.