How to place a default value within secure string without using get credentials

Hi Guys

I am aware this has been asked in the forums previously but I am having trouble with it. How do place a default within a secure string variable type not using get credential? I have tried using the following:

image

image

Not sure how to fix this. Can someone help please.

2 Likes

hi
you were almost done
this expression will give us string output
so use a string variable in the left side of assign activity

Cheers @bobby

1 Like

I want to pass this to secure string. So how do I create a secure string default value?

1 Like

so in that case pass directly the adPassword variable and no need of this expression
as it is already a secure string variable
Cheers @bobby

1 Like

what I am so confused. Pass it in directly. I cannot do that it gives me the save error? So all I want to do is populate a secure string value in a uipath activity with a value. So first I need a string with a value to be converted to secure string and then assign the activity with the secure string. I am making this too complex. Sorry you might need to dump this down for me. I am lost?

1 Like

got it
hope this thread would guide you

kindly let know for any queries or clarification
Cheers @bobby

1 Like

This uses orchestrator get credentials and I want to do it without using that method?

1 Like

Fine
in that case we need a source of secure string
we can get that from windows credential

Cheers @bobby

@bobby

Correct me if I’m wrong … As per my understanding you have to convert String to Secure string

for that use below code in assign actvity

new system.Net.NetworkCredential("", “Test”).SecurePassword

Test is your string otherwise you can able to assign string variable as well

4 Likes

Thanks @amaresan. That worked like a charm! :slight_smile:

1 Like

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