HI All
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 12:40 AM
Hi All,
my question is related to workflow if else condition
i have two Fields
1. date field
2.days_count
two days diff is days_count
so 0-5 days goes to Approval user manager
remain days goes to Approval another User
Please give me best code
Thanks ADV
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 01:01 AM
Hi @basha shaik
You can use below script in your workflow script activity,
(function execute(inputs, outputs) {
var today = new GlideDateTime(); // Get today's date
var startDate = new GlideDateTime(inputs.date); // Assuming inputs.date is the date field on your form which is Date exception field
var daysDiff = GlideDateTime.subtract(today, startDate).getDayPart();
if (daysDiff >= 0 && daysDiff <= 5) {
// Set approval_group to the manager's group
outputs.approval_group = 'Manager Group';
} else {
// Set approval_group to another group
outputs.approval_group = 'Another Group';
}
})(inputs, outputs);
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Feel free to connect with me on LinkedIn.
Best Regards,
Krushna Birla
Krushna Birla