I am trying to build my project in a different way to optimize performance but I’m running into an issue.
What I have now is a workflow that scrapes a table from a website, outputs it as a new data table, and then writes that table to an excel file. In the next workflow (which is invoked), I open up that excel file and read range to a new data table. I then run my operations on that data table and write the updated info back to the excel sheet
I’m trying to eliminate the excel sheet until I am done with the operations so I can write the whole table back at once, not piece by piece to the file on each iteration.
The issue I am running into is that in workflow1 (named for convenience) the data table that is generated (and that I would normally write to an excel file) is not in the global scope and won’t let me change it. I tried to pass it into workflow2 as an import argument but it isn’t showing up in the available variables.
Did u keep the the data table in the arguments section of work flow 1 to pass into the workflow 2,and please whether you have kept the data table as out argument…
Let me know any doubts
swimmerSet, Gender, and IsTeam are pretty self explanatory as they are variables passed from the first part of the workflow. tempDataTable is a global data table I have set up is used in this workflow. both swimmerSet and swimmerGender are imported through both 1 and 2
As far as mapping between 1 and 2 goes, the only thing that 2 does is open up an excel file created at the end of 1.
^That’s me trying to explain the relationship because I don’t understand what you mean by mapping
Can you please share the arguments in your work flow 1 and 2 not from import arguments, in the workflow or can you upload your xaml file so i can resolve it.
Thanks…
No actually tempDataTable is a data table I set in the main file and kept the scope as the whole project. I’m trying to get a table generated in workflow 1 into workflow 2 so that I may run my operations on that as opposed to an excel file
Main workflow (one you have screenshot of) - scrapes datatable from website and saves to a datatable variable titled dt1. It goes through and eventually invokes Workflow1
Workflow1 - this needs an in/out datatable argument. We’ll call this io_dt1 in workflow 1. Make sure to set the value of dt1 from Main to io_dt1 in the import arguments window.
Workflow2 - this needs either an in datatable argument, or an in/out datatable argument depending if data needs to be passed back to Main, or if the workflow just ends at this point. Make sure to set the value of dt1 from Main to this new in or in/out argument in Workflow2 import arguments window
EDIT: Just re-read your comment. If it is generated in workflow1, then you should set it as an out_argument in workflow1. All other information remains the same
the datatable is made in workflow 1, not the main one. The scraping happens in workflow 1 and thats where dt1 would come from. I need to be able to use dt1 in workflow 2.
@Kriptiko - check the edit. Everything else remains the same. Main should have a variable, Workflow1 should have an out_argument. Workflow2 should have an in_argument.
So you create the datatable in Workflow1 and save it to the out_argument we’ll call out_dt1. In the main workflow click “import arguments” on Workflow1 and assign out_dt1 to the dt1 datatable variable. In the main workflow click “import arguments” on Workflow2 and assign in_dt1 to the dt1 datatable variable.
This creates the datatable in workflow1 and passes it to main. Then main passes the variable into workflow2 where it is used for processing
You need to set 3 DataTables in Main, Workflow1 and Workflow2 as In/Out arguments and set them as part of the Invoke Workflow File activity. The way it is currently setup, anything you need to pass from Workflow1 to Workflow2 has to flow through Main. It looks something like this -
In that case, the simplest thing would be to invoke Workflow2 from withinWorkflow1 and pass the DataTable as an argument rather than invoking it from Main (as long as you don’t require the DataTable in Main for processing later)
@goodoldme - it’s generally best practice to avoid invoking a workflow within a workflow whenever possible as this makes the project much harder to follow without really digging into it
I’ve decided to revert to how it was before. It’s really not making as big a difference in performance as I once assumed. Thank you all for the input, I’m sure it will help me in future projects