Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Flow Designer action to decrypt Password2 variable

tsutherland
Kilo Sage

I have a flow to create a user and in that flow I use the "Microsoft Active Directory v2 spoke" action to generate a random password, which is a two-way encrypted password. I need to use this decrypted password and send it later in an email at the end of the flow.

 

I created a "decrypt password" action that I inserted into the flow but I am not able to get it to pass a decrypted password back to the flow.

 

The input on the action is the password generated

tsutherland_0-1699996327155.png

I made a script step using that input as follows

(function execute(inputs, outputs) {
var decpassword = inputs.password;
return decpassword.getDecryptedValue();
outputs.decpassword;
})(inputs, outputs);

I've tried it without the line "outputs.decpassword;"

I've also tried 

(function execute(inputs, outputs) {
var crpassword = inputs.password;
outputs.decpassword = crpassword.getDecryptedValue();
})(inputs, outputs);

This is my output variable

tsutherland_1-1699996509882.png

And my action output

tsutherland_2-1699996535778.png

In the parent flow, it is not returning any value:

tsutherland_3-1699996612217.png

If it looks like I'm throwing spaghetti at a wall to see what sticks, I am sort of because this is my first stab at something like this in flow designer. Hopefully someone can spot what I've done wrong or offer suggestions! TIA

 

7 REPLIES 7

Ruwan K
Tera Contributor

Thank you @harshav . Given code is nicely working. Can see the decrypted password/token values at the flow execution.  

Conorjc7def
Tera Contributor

Has there been any update on this? Have the same issue/

 

Rahul Kumar18
Tera Contributor

Facing the same issue, any update on this?