Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Date to String format

RudyS
Tera Expert

Hello,

 

I'm working on creating simple flow to send out an email to a group when a specific SCTask is closed out. The email should pull the New Hire Start Date, (which is in MM-dd-yyyy format) from the SCTask variable field. This is currently not happening, so I tried to use the Date to String transforms to convert it to String format. That also didn't work. See image of part of my flow setup. Could someone review and let me know what I'm doing incorrect here.

 

Thanks as always.

 

RudyS_1-1738618846418.png

 

RudyS_0-1738618674157.png

 

 

1 ACCEPTED SOLUTION

Hi Koteswara,

I see it's working now after I removed the Custom Format that I had selected in the Date to String transform function. 

RudyS_0-1738776399674.png

 

View solution in original post

9 REPLIES 9

Hi @RudyS ,


Nice that it got resolved.

Actually, I had the same thought. In my first response, I did not mention “Custom Format,” but in the screenshots you attached, the “Custom Format” value was present.

Yesterday, I tested the same scenario in my PDI, and I did not face any issues. I was able to see the selected date in the email. I think it might be a version-related issue since I am using a Xanadu version PDI. 

 

Screenshot 2025-02-06 100945.png

 




Thanks & Best Regards,
Koteswara Vara Prasad M

Lithesh
Kilo Sage

Hi @RudyS ,

 

I would suggest to create a flow variable and use the set flow variable and set the value of flow variable as your date field and then use the flow variable in the email. This will fix the issue.

 

If you find this works. Kindly Accept the solution and Let me know if you have any questions

 

Thanks,

Lithesh

Hi Litesth,

Please see my full flow in the response to Koteswara Vara Prasad M.

 

Thanks.

Ankur Bawiskar
Tera Patron
Tera Patron

@RudyS 

it should fetch the date variable and print in email body

what it is showing currently? what's not working?

The date format picked will be based on the session under which flow is running.

Is there any requirement to get date in particular format?

If yes then you will have to use flow variable and convert the date format

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Please see my full flow in the response to Koteswara Vara Prasad M.

It's not showing anything on the email Subject or Body. It's just blank.

Date should be shown in MM-dd-yyyy format. I used flow variable to convert the date format.

 

RudyS_5-1738685032659.png

 

 

Thanks.