Format date in flow designer

Erica2
Tera Contributor

Hello,

I'm currently encountering an issue where the date displays on the ritm description like this:

 

Erica2_0-1698892089059.png

 

The date value comes from date variable in the flow designer:

 

Erica2_1-1698892206868.png

 

I need help on switch it from 2024-06-30 to 06-30-2024 format.

 

Thank you

 

 

 

1 ACCEPTED SOLUTION

Hi @Erica2 

Try the script below.

 

var dt = fd_data._1__get_catalog_variables.recording_ends_date;

 

var gd = new GlideDate();

gd.setValue(dt);

return "Recording on:" + gd.getByFormat('MM-dd-YYYY');

 

Please mark my answer helpful and accept as solution if it helped 👍

Thanks,
Anvesh

View solution in original post

7 REPLIES 7

AnveshKumar M
Tera Sage
Tera Sage

Hi @Erica2 

You can create another flow variable and store the converted date using inline scripting.

 

var gd = new GlideDate(REFERENNCE TO YOUR DATE VARIABLE);

return gd.getByFormat('MM-dd-YYYY');

Then you can use the variable which have formatted date in description field.

 

If you don't want to use another variable you can directly use inline scripting in Description field value setting with same logic and construct entire description in script and return that value.

 

 

Please mark my answer helpful and accept as solution if it helped you 👍

Thanks,
Anvesh

Hello @AnveshKumar M 

I must have entered it incorrect, because it is not working:  Please help.  Thank you

 

Erica2_0-1698894458160.png

 

Hi @Erica2 

Try the script below.

 

var dt = fd_data._1__get_catalog_variables.recording_ends_date;

 

var gd = new GlideDate();

gd.setValue(dt);

return "Recording on:" + gd.getByFormat('MM-dd-YYYY');

 

Please mark my answer helpful and accept as solution if it helped 👍

Thanks,
Anvesh

Amit Gujarathi
Giga Sage
Giga Sage

HI @Erica2 ,
I trust you are doing great.
Please refer to below video for the same. 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi