in_Config("VarName").ToString not working

The below image to this text shows the argument panel inside the workflow where we are reading the config

What we need to do is while invoking that workflow with a INVIKE WORKFLOW File activity we need to assign that out_config to a dictionary variable named config

That is we are getting the value from that workflow - OUT direction

Now we can use that Config variable and pass that to Acme login workflow to a IN Argument which you have already defined

That is replace that in_config with variable name config

Cheees @mahrie

UiPath won’t let me set a value for “out_Config” within “InitAllSettings.xaml”

And it seems that “Config” for me, isnt part of the Framework cuz it can’t find that Var:

You are inside that workflow
We won’t be able to create there

We have to create in INVOKE WORKFLOW FILE activity
There in that activity click on import arguments and there you can create a variable named config

Cheers @mahrie

So it is Config(“ACME_URL”).ToString when using the config on Main /REF Level and passing it to another workflow within an invoke workflow file and its arguments

They just said I should do it in the InitAllSettings.xaml.

Now you say I should not do it there. I’m really getting confused here.

Here is the Error again I’m getting when trying to run the “InitAllApplications.xaml” file:
image

I changed nothing on the Framework, so I don’t think it’s a problem within the Framework.
In the config file the value i want has the name “ACME_URL”

Dear Mahrie,
You cannot do in Init xaml.Please do it in the Main.xaml -Initiallization block-Invoke Workflow-InitSttings

image

I would say that I do have it that way.


The screenshot is from within “InitAllApplications.xaml”

Initialize All Settings will return the Config (Out Argument out_Config) to the Main
Main is calling / invoking Initialize All Settings and stores the returned out_Config under a particular Variable (e.g. VarName = Config)

When calling / invoking Init All Applications form Main we pass the Config to the in_Config
And will use later in_Config when calling / invoking other XAMLS from there

Short Version:
Main → InitAllSetting: out_Config will get returned: we store it under the Variable: Config
Main → InitAllApplication: we pass the Config to the in_Config
InitAllApplications → AnotherXAML

  • AnotherXAML defines an in Argument: in_Config
    we forward the in_Config from InitAllApplications to the in_Config from AnotherXAML

I checked it, it already was like that.

i updated the post above
In case of trouble also do debug the implementations (Main and other XAMLs) and inspect where the Config is lost / turns to null

I think the problem sits somewhere else. Because all you say is within the Framework, but I did not change a single thing in it. So i don’t think the problem lays there.

Im getting the Error from above and also this:
Invoke ACME_Login workflow: Object reference not set to an instance of an object

I feel like the problem is in the in_Config(“VarName”).ToString
Because as soon as i put this ii, I get the Error. If I pass the real URL instead of this, it works.

Dear Mahrie,

Did you pass this Config to the input argument in the Invoke workflow where you are getting the error.
And before the invoke workflow activity add an activity MessageBox and write Config(“ACME_URL”).toString and keep a debug breakpoint — whatever name you have kept in config excel so as to check if config value exists

Could you please share the screenshot of the above Invoke workflow activity with arguments pop up

Thanks,
Geetishree Rao

Thats exactly why i think, the Problem lays in the in_Config(“ACME_URL”).toString
Because even if i comment out the invoke and start the InitAllApplication.xaml with nothing but the comment and a log message, i get the same error.

Here the wanted screenshot: (i hope this is what you mean, its from inside InitAllApplication)

No … I meant the one in main.xaml

@mahrie
the fastest way to get it sorted out would be to debug it along with breakpoints and partly stepwise debugging.

Thats the common and best practive in case of analysis will not clear it.

While debugging we also can benefit from manipulating variables etc. have alook here:

2 Likes

Alright! I’m sitting down now with my work team to find the solution. If we find it, I will let you all know.

Mahrie :bear:

Please keep breakpoints and debug :slight_smile:

Hi @mahrie

Can you check whether you have created a variable named “ACME_URL” in the Login.xaml file?

Before invoking login.xaml, check whether any items present in the in_Config dictionary

Hi @Shivaraju,

Please verify below:

  1. Initallsettings invoke workflow activity, out_config is assigned to Config.
  2. Initallapplications jnvoke workflow activity, in_config is assigned the value config.
  3. Login acme invoke workflow activity, in_config is assigned value in_config. If you don’t want to pass whole config to this workflow, the way you are passing config value is also right.

And then check that acme URL defined in the config has a value defined there.

One thing you can do to verify is before calling acme login invoke workflow activity, using log message, print the value in_config(“variable”).tostring and see if it exists?

If it doesn’t, make sure step 2 is verified and done.
Also if you can show screenshot of step 2, we can help you further.

Regards
Sonali

You have to initialize in_Config.

Go to your variables pane and in the default for in_config put new dictionary(of string, object)