Can't read Credential asset from config file

It’s in Level 3 - Advanced Training, first assignment. I’m strucked:

"The Config dictionary is already used as input argument in the InitAllApplications.xaml

workflow, so let’s change the filename path to in_Config(“UiDemoPath”).ToString. Next,

we need to invoke the UiDemo_Login workflow, import the arguments, and pass the

Credential from the Config dictionary, as follows: in_Config(“UiDemoCredential”).ToString."

The first task: change the filename path to in_Config(“UiDemoPath”).ToString, I have done it succesfully.

But I can’t work out the seconed one.

Because the 2 tasks are very similar, I can’t figure out why. So I trying to write a loop to see what’s in side in_Config after initSetting.

I write both “UiDemoPath” and “myCredential” in the assets sheet of config file and create asset accordingly.

The outcome of the loop shows only “UiDemoPath” was in the dictionary, but not “myCredential”:output

However, I keep everything the same, only delete the “myCredential” in Orchestrator, then recreate it as a text type, not credential, rerun the test, myCredential is in the in_Config this time! When I change myCredential back to credential asset type, it not there again.

Why?

By the way, I have checked the in_Config type is system. Collections.Generic.Dictonary<System.String, System.Object>.

3 Likes

Hi @luojieemily
instead of get credential
you can use type into and pass the value as in_Config(“UiDemoCredential”).ToString

get credential are used to read the asset namebased on username and password given in orchestrator

Thanks
Ashwin S

Hi @luojieemily

As i can see the error tells that the value of an object has no value.May be you can post your xaml here or elaborate more so we can easilly address the issue.

cheers :smiley:

Happy learning :smiley:

4 Likes

@AshwinS2 I think I’m stucked in in_Config(“UiDemoCredential”) already.
@pattyricarte I can’t upload zip file as “new users can not upload attachments.” :rofl:
Here is dropbox link

Thank you!

1 Like

After some reserch, I figuered it out.
In the config file, I need to put the credential asset in “Settings” sheet, not “Assets” sheet.
I guess the reason is:
In the InitAllSettings.xmal, contents of “Settings” and "“Constants” sheets are read into config dictionary, then no other activities in InitAllSettings.xmal, just output the config dictionary. Then, when we use Get Credential activity somewhere later, it read the credential name from the dictionary, then featch the value from Orchestrator.
As for the “Assets” sheet, it’s different. There is “Get Asset Value” activity in InitAllSettings.xmal. already, it read the asset value from Orchestrator. If the asset is credential, it can’t get it’s value, we have to use get credential activity instead of Get Asset Value.

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