If Workflow1 shows Screen1 then Screen1 calls Workflow2, can i use the var dataset in Workflow2 from Screen1 or does Workflow2 re-initialise the var dataset for its own use?
Is there any documentation on the var dataset?
I’m just re-doing my code for the screen validation but it’s not working because i suspect the var dataset has been reset and the values from Screen1 are not available any more.
Can’t find it in the documentation at the moment, but the behavior you describe is expected.
Each workflow which starts with <workflow> element creates a new scope (see here) and VAR dataset. This datasets is only visible to the screen(s) which is relative to it. If the screen in its case calls another workflow it will create its own VAR dataset and shadow any other already existing.
In your example the setup is as follows:
--> Entry to the Workflow1 Datasets: var ... (any other declared dataset) --> Show screen Screen1 Visible Datasets: var ... (any other declared dataset) --> Call Workflow2 Datasets: var (this is a new clean dataset which does not have any relationship to the VAR dataset created in Workflow1) ... (any new datasets) ... (any datasets declared in Workflow1, given that there were no new datasets declared in Worklow2 with the same name)Therefore your reasoning seems to be correct and you’ll need to create some other dataset if you want data to be available across the workflows.