How to generate unique one time 4 digit number in workflow and send by Notification to user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 04:43 AM - edited 09-30-2024 04:49 AM
Hi Team,
I have to integrate IVM vending machine to ServiceNow ,In the workflow Once Task generated and assigned to ServiceDesk .4 digit random number(pin) send to the IVM team via API also PIN information with will be sent to user via email from ServiceNow ,The PIN should we valid for half n hour , pin user used to pick any item from IVM,I am stuck How i can generate PIN in workflow also How to pass it in the Notification.
Each request has a unique one-time-use collection code, sent securely on users email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 04:54 AM - edited 09-30-2024 04:55 AM
Hi @vinitaraico
You can make use of below line of code in a Script step inside your workflow :
workflow.scratchpad.ivmPin = Math.floor((Math.random() * 9000) + 1).toFixed(0);
Use this workflow variable in your notification as well to send it to the users.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.