
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2020 12:18 PM
Creating an Action in Flow Designer. What it does is take a Date/Time value, make it a string and pass it to the output variable.
The input section of the Action catches my RITM and a Date/Time variable (original_date).
Next I have a Script step and a Notification step.
The Script step takes the Date/Time variable (inputs.original_date) and transforms it to a String (outputs). This string value is output to a string variable (outputs.some_date).
Next is the Notification Step. I created a simple notification that I thought would be able to use this variable (some_date) as a variable in the notification on the What it will contain tab, in the Message HTML field, like this ${variables.some_date}, but no. I can use the un-altered beginning variable that I pass into the Action ${variables.original_date} but not my transformed date to string.
What am I missing here?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 10:19 AM
I relented on this one. Just took step back, went to the catalog item and changed the variable type from Date/Time to Date. Now I have a simple date that'll do the job for now. If I'm pressed to pass another type of date format I'll do it at the catalog item before progressing through the flow.
Thanks for your input

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2020 12:39 PM
I propose adding some screenshots. Maybe I can help if I can better understand what you're trying to do. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2020 01:22 PM
There you go.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2020 01:21 PM
The input section of the Action catches my RITM and a Date/Time variable (original_date).
Next I have a Script step and a Notification step.
The Script step takes the Date/Time variable (inputs.original_date) and transforms it to a String (outputs). This string value is output to a string variable (outputs.some_date).
Next is the Notification Step.
I created a simple notification that I thought would be able to use this variable (some_date) as a variable in the notification on the What it will contain tab, in the Message HTML field, like this ${variables.some_date}, but no. I can use the un-altered beginning variable that I pass into the Action ${variables.original_date} but not my transformed date to string.
Thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2020 02:58 PM
Did you check if the date format that you created is in the right format?
ServiceNow by default use yyyy-MM-dd hh:mm:ss date/time format internally. The display format may be set by each enduser. Run test on Action you've created and check the output to make sure the format is the same as the unaltered date/time variable.