- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I want to set a datetime type as an input for a subflow.
I want to set the current time as this value, but it's not working...
Does anyone know a good way to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Refer below image:
If you want to get date/time as current date ,use script type as per below and set default value as javascript: new GlideDateTime(). i have just tested this, its working
[ Architect | Certified Professional]
Was this response helpful? If so, please mark it as ✅ Helpful and ✅ Accept as Solution to help others find answers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Refer below image:
If you want to get date/time as current date ,use script type as per below and set default value as javascript: new GlideDateTime(). i have just tested this, its working
[ Architect | Certified Professional]
Was this response helpful? If so, please mark it as ✅ Helpful and ✅ Accept as Solution to help others find answers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Glad I could help! If this solved your issue, please mark it as ✅ Helpful and ✅ Accept as Solution so others can benefit too.
Chavan A.P. Technical Architect | Certified Professional
[ Architect | Certified Professional]
Was this response helpful? If so, please mark it as ✅ Helpful and ✅ Accept as Solution to help others find answers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
if you want current date/time then why to have that as input.
You can use Flow Variable in subflow and store current date/time and then use it
Another approach you can try is what @Chavan AP mentioned.
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
yesterday
@bonsai You can store the current time in flow variable and pass that as input to your subflow.
new GlideDateTime(); will give you current date time.
But if I understand correctly, you dnt really need to pass current time as input because that will be the time when subflow will start executing so instead of passing it as input you can easily get date time in subflow itself in your subflow script.
In subflow script or variable also you will get it using new GlideDateTime();
Raghav
MVP 2023