Can I set the current time as the default input value for a subflow?

bonsai
Mega Sage

 

 

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?

bonsai_0-1757031282171.png

 

1 ACCEPTED SOLUTION

Chavan AP
Tera Guru

 

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 

 

Screenshot 2025-09-05 at 04.42.43.png

Chavan AP
[ Architect | Certified Professional]

Was this response helpful? If so, please mark it as Helpful and Accept as Solution to help others find answers.

View solution in original post

6 REPLIES 6

Bhuvan
Tera Sage

@bonsai 

 

First check whether you need to create subflow like this as you have many out of box date & time comparisons via filter conditions at table & field level. You can also use Flow Logic for date comparisons before proceeding with set of actions.

 

If you still want to create, you can use server side script to set date/time as input in subflow. Below is a sample for Date as input and logic is same for date/time using  javascript:new GlideDateTime();

Bhuvan_2-1757042167655.png

Bhuvan_3-1757042179559.png

Bhuvan_0-1757042137136.png

Bhuvan_1-1757042150703.png

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

@bonsai 

 

Did you get a chance to review this ?

 

As per community guidelines, you can accept more than one answer as accepted solution. If my response helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan