- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 04:57 AM
Hi,
what am I missing in this flow? The workflow is not triggering the related SCTASK because of the "cannot convert null to an object" error
see below -
Regards
CarolMa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 05:44 AM
@CarolMa6 Use below scripts. Don't use getDisplayValue() for date type of field. It is giving undefined value . I tried below script in PDI and it worked.
var date = fd_data._1__get_catalog_variables.termination_date;
var gdt = new GlideDateTime(date + " 00:00:00");
gdt.addSeconds(54000);
return gdt;
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 04:59 AM
Hi @CarolMa6
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0855574
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 05:09 AM
See screenshot below issue not related the "Run As" field set to System User
Regards
CarolMa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 05:16 AM
the error clearly is because of that script.
Is that variable as standalone and not part of MRVS?
If yes then Did you check if variable name is correct?
that variable is of type Date or Date/Time?
Did you add logs and see what came in date variable?
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
08-12-2025 05:34 AM
Hi,
Probably you need to make sure that the "date" variable in the first line contains some data, before you try to add/convert the date to a datetime.
Something like below might help (somewhat simplified example).
var date = fd_data.trigger......getDisplayValue();
var gdt;
if (!date){
// some action to take if the value does not exist
gdt = new GlideDateTime();
....
}
else{
gdt = new GlideDateTime(date + ...);
gdt.addSeconds(...);
}
return gdt.getValue();