Whats wrong with below code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 06:31 AM
Hello All,
Whats wrong with below code? I have included this in a flow variable. I am selecting Effective date as Mar 4, 2024. However the datediff is not being calculated correctly. Included a screenshot of logs as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 06:43 AM
The day difference is correct the only thing you need to add is Math.floor at the end to avoid decimal values. If you are looking for a Positive value for the parameters passes exchange the dates while comparison.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 06:47 AM
try this, you have used the reverse and hence it's negative
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:26 AM
Thanks Ankur. I also see a problem in creating scheduled job. Do you see any anomalies here as well?
When i search the sys_trigger table with job name, it does not show anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 08:04 AM
it won't be present in scheduled job
the records created in sys_trigger are triggered by system based on next_action date/time field
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader