Flow Designer action to decrypt Password2 variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 01:18 PM
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
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
And my action output
In the parent flow, it is not returning any value:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 01:42 PM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 02:59 PM
Thank you! Progress....the runtime value now shows as "undefined" instead of blank, which is what I was getting:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 05:09 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 08:09 AM
Not 100% sure what you're wanting but I posted the action input screenshot in my first post. This is what the generator does:
And when I last ran it, here were the inputs and outputs
And the step details
I appreciate your help and let me know if there is more information/detail you need.