Default value for Argument to read from Config file - Academy Advanced

configuration
academy2

#1

Dear all,

I am stuck with the Security Hash case in the Advanced Academy.

In the System1_Login workflow, I have the in_System1URL argument for which I should put a default value (the website address) to be read from the Config file.

Unfortunately if I put as a default value the website address directly, instead of reading it from the Config file, I get an error when I invoke the System1_Login workflow in the InitAllApplications workflow.

Can anyone give assistance on this?

Thanks a lot for your help

Kind regards

Gennaro


#2

Are you missing to set the value of arguments while invoking ‘System1_Login’ workflow?

Like this,

Thanks,
Rammohan B.


#3

hi @Rammohan91

thanks a lot for your reply. I have it, as per following screenshot

if instead of “in_Config” I use “Config” as per your screenshot, a different error occurs:

What can it be? I also attach the Config file in case there is a mistake.Config.xlsx (12.7 KB)

Thanks

Kind regards

Gennaro


#4

Thats okey. You don’t have to change the variable name.

Please cross check if you are passing the ‘Config’ value while invoking ‘InitiAllApplications.xaml’ file.

Also, Run the workflow in the debug mode to check exactly the activity that throws the error.

Thanks,
Rammohan B.


#5

Hi @Rammohan91

thanks for your reply. Actually I am running InitallApplication itself, I am not invoking it.

I ran debug mode with no luck. The exact activity that throws the error is “Invoke Login_System1”.

In “Main” yes, I am passing Config, but currently I am focusing on InitallApplication and not on main. In attachment below, just the portion of the case with InitallApplication. Could you please have a look, by running InitallApplication?

Test.zip (862.3 KB)

Many thanks

Gennaro


#6

I think i got the issue. Under your ‘InitAllApplications’ workflow, you are invoking ‘InitAllSettings’ and storing the config values in a variable called ‘out_config’. However when you invoked ‘System1_Login’ you are passing the values of arguments from ‘in_Config’ which is an IN argument of ‘InitAllApplications’ and will be empty, Replace it with ‘out_config’ for now if you want to test. However in the actual case it has to be passed from main.xaml into in_config only.

Thanks,
Rammohan B.


#7

Hi @Rammohan91

thanks for your help. That’s awesome! However I think the problem is deeper than that. If you now run “Main” on the case below (please download this new version here), it returns an error in the same place “System1_Login”. This time the error is “The given key was not present in the dictionary”.

test.zip (3.3 MB)

What can it be?

Thanks

Kind regards

Gennaro


#8

Hi @Rammohan91

Here’s the error given, in correspondence of “System1_Login”:

If you could please help it would be amazing

Thanks

Kind regards

Gennaro


#9

Please check the name of the Name column of Config file and verify the same are you using in the workflow to get the value


#10

Hi @prankurjoshi,

thanks for your help. I did it and they are the same, except the “in”. In attachment the config file I’m using. Can you spot an inconsistency that I couldn’t find?

Thanks

Kind regards

Gennaro

Config.xlsx (12.7 KB)


#11

How did you pass the argument IN for Login sequence?


#12

Hi @prankurjoshi,

I passed it like this:

Thanks

Kind regards

Gennaro


#13

This is your login sequence, I wanted to know how did you pass it from Main.xaml->Init State where you have invoked Login Workflow

image


#14

Hi @prankurjoshi

I passed it like this:

but actually this works.

Where it does not work is after, when it invokes the initallApplications:

returning the following error: System error at initialization: The given key was not present in the dictionary. at Source: Invoke workflow file: mscorlib

if it can help, please find the case in attachment: test.zip (3.3 MB)

Thanks

Kind regards

Gennaro


#15

Too many changes needed in the workflow, you should try to get credentials from Orchestrator asset instead. Secondly you are not passing In Argument to Login Workflow from Init State. There are no credentials to use for Login


#16

Hi @prankurjoshi,

thanks for your reply. I do get credentials from Orchestrator.

Could you please explain how I can pass in argument to Login Workflow from initstate? Maybe this could fix my problem :slight_smile:

Thanks

Kind regards

Gennaro


#17

@prankurjoshi

the thing is, the tutorial suggests that in “Invoke initallapplications workflow”, I should only pass in_Config. But now you are telling me to pass, in “Invoke initallapplications workflow”, also an argument to Login workflow. How? If you could help it would be really appreciated.

Thanks

Kind regards

Gennaro


#18

Hi @prankurjoshi

any news? if you help me on his I could complete the case

Thanks

Kind regards

Gennaro


#19

Below screenshot showing that InitAllApplications.xaml called from Main -> Init

After this when you open the workflow IntiAllApplications.xaml, it would look like this

I hope this would help you, if not do let me know


#20

Hi @prankurjoshi,

thanks a lot for your suggestion, it fixed the problem!

Kind regards

Gennaro