Need help on date calculations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2025 05:39 AM
I have a requirement to trigger a notification on a contract's end date minus the notice period minus 30 days.
I am free to implement this however, so I figured to create a flow for this which runs on a daily schedule.
However, I am having difficulties to calculate the date.
This calculation needs to be 30 days before a contract's notice period.
The contract has the field ast_contract.ends set and a custom field (type duration) ast_contract.u_notice_period (for example 90 days), in this scenario the notification would trigger 120 days before the contract's end date.
I created a flow which runs on a daily schedule, I used a Lookup records flow action to retrieve all active contracts, followed by a for each action to loop through the records.
This is where I'm stuck. I can't figure out how to calculate if today is the date where the notification should be triggered. So I am looking for help in scripting ast_contract.ends-ast_contract-u_notice_period-30 days
Any input/advice/suggestions would be appreciated. I've looked at the GlideDateTime API's and the Durationcalculator script include but I just don't understand the concept with the duration field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2025 08:48 PM
Hope you are doing good.
Did my reply answer your question?
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
10-06-2025 07:04 AM
I ended up deleting the column and recreating it as an integer. This allowed me to perform the calculations I needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2025 07:15 AM
Glad to know.
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
