
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 10:32 AM
OK. I know this should be real simple but not getting the code to work.
I am setting a date field using a script instead of a data pill in one of the steps in a flow using the following code:
var invite_dt = gs.nowDateTime();
return invite_dt;
The system keeps resetting the above code to just GlideDateTime.
I have spent an hour figuring this seemingly simple task out and now reaching out to the experts here.
Thanks in advance!
Mahesh
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:09 PM
If you're just wanting to set a field in flow to be the current time, GlideDateTime will work
You can even reference the community live stream

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 03:21 PM
Kieran:
I have tried your code multiple times; it is just not saving it. I am not sure if this is SN's way of saying that is bad code but that is what is happening. I have no information on what is wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:09 PM
If you're just wanting to set a field in flow to be the current time, GlideDateTime will work
You can even reference the community live stream

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:21 PM
Hi Mahesh,
Use GlideDateTime() in your code.
The code should be like-
var invite_dt=new GlideDateTime();
return invite_dt.getDisplayValue();
Warm Regards,
Shubham Bongulwar
Please mark helpful or correct if it helps!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:54 PM
Phew..finally! Thanks Kieran. Thanks Shubham!