flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2024 09:51 PM
Can i create 8 digit random password in flow designer?if yes how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2024 10:02 PM
Hi @HARSHA GOWDA R
Can you please explain the exact requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2024 10:06 PM
Hi @Deepak Shaerma
The scenario is after the approval from the manager for a password reset,the new random 8 digit password should be generated and it should trigger a notification in flow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2024 10:07 PM - edited ‎04-14-2024 10:11 PM
Hello Harsha,
You will have to create a custom action for this.
I have not defined any input but if required you can add on.
Please refer below screenshots.
If my answer has helped you in any way please mark it as correct or helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2024 10:20 PM
Hi @HARSHA GOWDA R
In your flow designer, after the managers approval trigger, add and action and Choose the Script Action to execute custom JavaScript code.
(function() {
// Function to generate a random 8-digit number as a string
function generatePassword() {
var min = 10000000; // Minimum 8-digit number
var max = 99999999; // Maximum 8-digit number
var password = Math.floor(Math.random() * (max - min + 1)) + min;
return password.toString();
}
var newPassword = generatePassword();
// Assuming ‘password_field’ is the field where the new password should be saved
// And ‘current’ is the current record object in the Flow context
current.password_field = newPassword;
current.update(); // Don’t forget to update the record with the new password
// Return the newPassword for further use in the Flow, like sending it in a notification
return {
newPassword: newPassword
};
})();
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning ‌‌
Thanks & Regards
Deepak Sharma