Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Condition for 60 day date validation

miro2
Mega Sage

Hi,

I have to create a condition to meet the below requirement:
Date of today is greater than Date of field 'Sent for Approval' + 60 days. The Date of field 'Sent for Approval' is a variable and I was able to add its value in the Dashboard using database view. I want to check which condition will be better: 

javascript:gs.daysAgoStart(60)

or '60@days@ago'?

 

The value field is the date of the field 'Sent for Approval'

miro2_0-1769771597677.pngor

miro2_1-1769771616676.png

 

 

 

2 ACCEPTED SOLUTIONS

Hi @miro2 

That’s a challenge. You need to store this in a proper date format first; then you can compare it. Otherwise, there’s no easy or direct way to do it. A date can be compared to another date, but a date versus a string cannot.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

@miro2 

that's not going to work.

That value holds string and you can't compare it with another string which holds the filter.

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

17 REPLIES 17

Dr Atul G- LNG
Tera Patron

so you want 

 

Today date is greater then appvla +60 days?

 

Liek

 

30th Jan > approval date 15th Oct+60 days

 

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG  
yes, like in your example: Today > Value field 'Sent for Approval'( e.g. any date in Oct) + 60 days

So in this, are you storing the approval date plus 60 days in another field? then it is easy to get it.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

@Dr Atul G- LNG 
No, I'm storing the approval date only in 'Value', and in the condition I need to use 60 days to meet the requirements.

miro2_2-1769774335140.png