Flow Designer Action Output Variable

ericgilmore
Tera Guru

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? 

1 ACCEPTED SOLUTION

ericgilmore
Tera Guru

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 @hozawa , @Erik Gunther 

 

View solution in original post

14 REPLIES 14

Erik Gunther2
Kilo Guru

I propose adding some screenshots. Maybe I can help if I can better understand what you're trying to do. Thanks.

There you go.

ericgilmore
Tera Guru

The input section of the Action catches my RITM and a Date/Time variable (original_date).

find_real_file.png

 

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).

find_real_file.png

 

Next is the Notification Step.

find_real_file.png

 

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.

 find_real_file.png

 

Thoughts?

Hitoshi Ozawa
Giga Sage
Giga Sage

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.