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

harshav
Tera Guru

please update your action script and try:

(function execute(inputs, outputs) {
var Encrypter = new GlideEncrypter();
var crpassword = inputs.password;
outputs.decpassword = Encrypter.decrypt(crpassword);
})(inputs, outputs);

 

Thank you! Progress....the runtime value now shows as "undefined" instead of blank, which is what I was getting:

tsutherland_0-1700002767276.png

 

Can you please add the screenshot of your inputs in the step as well as add the info statement to see that you are getting a value.

Not 100% sure what you're wanting but I posted the action input screenshot in my first post. This is what the generator does:

tsutherland_0-1700063888727.png

And when I last ran it, here were the inputs and outputs

tsutherland_1-1700063950200.png

And the step details

tsutherland_2-1700063996863.png

I appreciate your help and let me know if there is more information/detail you need.