how to calculate days using mailscript which is usefd in notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 11:21 AM
I need to send expiry notification based on valid to in knowledge base
i have created flow design it is triggering exactly using lookup activity
but in the notification, am using mail script to calculate days based on valid to field in knowledge article
as below
please find logs
12th jun 15:30 aest(same day output)
validDateFormatted 2024-08-11
todayDate 2024-06-12
days 59
finalDays 59
dur 2024-06-12
12th jun 9:15 aest(same day output)
dur 2024-06-11
validDateFormatted 2024-08-11
todayDate 2024-06-11
days 15
dur 2024-06-11
finalDays 60
Please advice how to write mail script which should consider correct days i.e., 60 days irrespective of time on same day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 10:57 AM
Hi Ramu8,
The simplest thing is to grab the day, month and year for each of your datetime variables and then just create a string in the form of year-month-day 00:00:00. You can then use a setDateTime() passing that string and your various datetime variables will all be for the start of the day. Depending on how you need to do you revaluations, the 00:00:00 can be set to any relevant value (e.g. grab the time piece from todayDate and apply it to all relevant variables).
:{)
Helpful and Correct tags are appreciated and help others to find information faster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 01:49 AM
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark