Jump to content

Date format in email templates


Alisha

Recommended Posts

Hello,

Is it possible to change how the date appears in custom fields?

I have used a Date Control and h_custom_a in a capture, but when I use the custom field in an email template, the date shows as yyyy-mm-dd. I would like it to show as dd-mm-yyyy. Is there a way to change this please?

If I use h_custom_21, then a time shows, which is not what we want.

Many thanks,
Alisha

Link to comment
Share on other sites

Hi @Alisha,

If you were to wrap the Date value with square brackets, the date will be formatted automatically as per your Profile's Regional Settings. Please refer to "Date Formatting" section in the Wiki page below:

What is the source of the Custom attribute? If the value is updated through a Hornbill Automation in a Business Process, you can wrap the injected variable (added via the Variable Picker) with square brackets to achieve the same behaviour.

image.png

Ehsan

Link to comment
Share on other sites

3 hours ago, Alisha said:

I have used a Date Control and h_custom_a in a capture, but when I use the custom field in an email template, the date shows as yyyy-mm-dd. I would like it to show as dd-mm-yyyy. Is there a way to change this please?

If I use h_custom_21, then a time shows, which is not what we want.

@Alisha h_custom_a being a VARCHAR field (meaning it will store values as string) is not able to convert or format date values. Because the value in this field is treated as sting, the system has no knowledge that the value is actually a date (or any other type like numbers for example, everything in this field will be a string).

One option which you also identified is to use a dedicated date/time field for this but this is not preferred by you since it displays the time.

Another option is to (re)format this field in the Business Process prior to using it in the email template. A similar query was raised before, to which Steven provided the solution. Have a look and see if the information there answers your query.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...