Doubt in Arguments

Hello guys

I am using arguments to get the status of the excel row

The workflow will be like
- In Process Transaction in the process workflow I have assigned the status in between the workflow as Out Argument and passed it to the Main Workflow
image

  • It is returning an empty string

Anyone know what is the mistake I have done

@Palaniyappan @Deebiga_Kandasamy @ppr @lakshman @Srini84

Regards
Sudharsan

check if arg_status is the out Argument
maybe there is an out argument called out_status and requires to get the assignment on the end

it is recommended to use the prefixes for indicating the direction of argument within the argument name like in, out, io

Hi @Sudharsan_AIT ,

I see you are ending with a Throw, this means that normal arguments do not normally work within that Try Catch.

If you want to pass out info to the Main workflow, coming from an error in the try, you need to 1st init a DataTable or a Dictionary in the main. Set it as In/Out inside the Process.xaml, and then fill it inside.

Normal “String Out arguments” do not carry information out of the TryCatch.

Please try it and update us!

Best Regards,
Ignasi

1 Like

I have changed the direction to In/Out and still facing the same problem

Sure, will keep that in my mind

No all the arguments have been assigned

Regards
Sudharsan

did you also change the argument type to Dictionary?


If you changed to in/out, but you kept the Argument Type to “String”, it will not work. you need some kind of structured data, like Dictionary, DataTable, or Lists

  • For reference, my Process contains the assign with the following data:
io_dict_DataForReport("Data") = "Failed"

Checking out of the process, on Main, my key io_dict_DataForReport(“Data”) contains the “Failed” string in it.

io_dict_DataForReport(“Data”) = “Failed”

Instead of “Data” can i use string argument?

“Data” in io_dict_DataForReport(“Data”) = “Failed” is just the key.

If you want to get the “Failed” information on Main, instead of getting it from your out_String argument, you can refer to Var_Dict_DataForReport(“Data”) and this will contain your value.

You can of course change the key “Data” if you want, by using any other string, inclusive the one in your argument. But bear in mind that you will have to refer to that one, also on Main.

Example:
Process: io_dict_DataForReport(“Data”) = “Failed”
Main: var_dict_DataForReport(“Data”) will have the value: “Failed”

Process: io_dict_DataForReport(in_StringVariable) = “Failed”
Main: var_dict_DataForReport(var_StringVariable) will have the value: “Failed”

Find below the example:
Process:

Main:
image

Example workflow
RoboticEnterpriseFramework2.zip (1013.8 KB)

I end up with this error

Assign: Cannot create an L-value from the given expression with property ‘set_Item’ because the target object is null.

What mistake have I done?

Regards
Sudharsan

I did attach above an example of the 2 types of variables, and a breakpoint to show that one keeps the data, and the other does not.

Your steps should be:

1- INIT dictionary on Main
→ Based on your message, make sure it has the correct init:

New dictionary(Of String,String)

2- Create the dictionary variable inside the Process. with type “In/Out Dictionary (Of String,String)”

3- Fill the dictionary before throwing

4- Make sure you connect the variable from the invoke Process, to the init dictionary you created on Main

5- Dictionary will have your data, after the Catch part of the TryCatch

1 Like

Hey @ignasi.peiris

Thanks for the input man ,It’s Working like a charm

Regards
Sudharsan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.