I think the current issues already reported are a bit different.
While using REFramework and the bot is executing the actions in Process.xaml the Datatable io_dt_TemplateFileData(From now DT) is extracted properly in the Workflow EKR_Retrieve_data. However the DT is not being transfered above when an error occurs in PrimaryData_Export.xaml.
In this picture the DT is read properly in EKR Workflow
@Fer_Fer you need to check basic thing 1 Check argument Type "in or out " 2 Check Datatype Pass and received data type
Best Practices for Data Type Passing:
Use Arguments:
Leverage the Arguments pane in UiPath Studio to define input and output data types for your workflows.
This ensures type safety and clarity during development and execution.
Explicit Casting (When Necessary):
If you need to convert data types within workflows for specific operations, use explicit casting techniques (e.g., CInt(value), CStr(value)) with caution.
Consider alternative approaches (e.g., using the correct data type initially) to minimize casting and potential errors.
Clear Variable Naming:
Assign descriptive names to variables that reflect their data types.
This improves code readability and maintainability.
Resolving Data Transfer Issue:
Scenario 1: Missing Argument in PrimaryData_Export.xaml
Verify that PrimaryData_Export.xaml has an argument defined to receive the io_dt_TemplateFileData Data Table.
If missing, add an argument of type DataTable and link it in the Invoke Workflow activity calling EKR_Retrieve_data.xaml.
Scenario 2: Exception Handling:
Implement error handling in EKR_Retrieve_data.xaml using Try Catch blocks:
Wrap the Data Table extraction logic within a Try block.
In the Catch block, handle exceptions gracefully, potentially logging them and potentially providing a default value for the Data Table.
Modify PrimaryData_Export.xaml to handle the possibility of an empty Data Table:
Check if the received Data Table is Nothing (UiPath null equivalent) before using it.
Take appropriate actions (e.g., logging, skipping operations) if the Data Table is empty.
Additional Considerations:
Ensure proper execution order in the REFramework workflow. EKR_Retrieve_data.xaml should execute before PrimaryData_Export.xaml.
Consider using Rethrow if the error handling in EKR_Retrieve_data.xaml isn’t sufficient and you want to propagate the error to the main workflow.
Review your logging strategy to capture potential errors during execution.
Utilize debugging tools (UiPath Studio’s debugging capabilities) to step through your workflows and pinpoint the issue.
Use Try catch in the workflow you are trying to invoke and declare one additional out argument of type System.Exception. In catch section assign the exception to out argument we declared. Don’t throw or rethrow the exception.
This will result in peacefully execution of the invoked workflow so will return all the Out arguments. Read those values in the calling workflow and then check if the local variable which will hold out argument value of the exception isnot nothing. If true it means there was exception and you can take further action you want like throw it or handle it as per requirement.
Reminder that, when using an LLM to generate your reply you are supposed to indicate you used an LLM.
Your response looks straight of an LLM considering the formatting, bulletted points and some of the text. Please follow forum guidelines and note you used an LLM to make your reply.
This is default behaviour UiPath and .NET I believe.
Some variables will appear to be populated after an error but thats due to them being a ‘by Ref’ argument instead of a ‘by val’ argument. A by ref means you are referencing the same object in memory, so the out workflow actually isn’t even needed. You cannot explicitly control if its a 'by ref in UiPath so its usually that ‘simple’ data types are by val and more complex ones are ‘by ref’.
It appears Datatable is a ‘by val’.
As such you have to do some work to make this happen to ensure no error ever gets thrown or the data is passed out via the error, a solution such as the one provided by Ashok is a possibility.
I feel like you should revisit the design somehow though since this seems to be a problem ridden scenario.