How to access a document schema date parameter from Automation Chains

Hi all,

I was trying to adapt the nuxeo studio template for Holiday request and have problem to find the correct syntax for the following:

My document has a customised schema which include two properties with “Date” type.

In my automation chain I want to send a Notification -> Send E mail and ton include those “date” inforamtion.

For the moment, in my mail “message” part, I have used the following syntax: @{Document[“SchemaName:date_start”]}

As a result I receive an email with the following (in addition to the reset of the e mail which is OK):


Question is: how to display the date in readable format ??

Thank you

PS: I looked in the documentation but all the examples I found are concerning “CurrentDate” but never for a parameter that belong to a Document schema.


1 votes

5 answers




Another (tested succesfuly) solution is to use the Scripting function provided for handling date obejcts:

For instance, the following sequence will update the description field with the date value of the dc:modified property:

Fetch > Context Document Document > Update Property ((value: @{Fn.calendar(Document[“dc:created”]).format(“yyyy-MM-dd”)}),(xpath:dc:description))

In case of writing the email in an ftl template, you can set the value you want to use as a context variable before calling the SendEmail operation, and then access the value you computed before in the Context object

1 votes


I did two things and now it's working so I don't know which one among those are required…

Both actions are:

  • replacing ' par "
  • deleting the ?string.full

My final working syntax is the following: Document[“SchBonConges:date_start”]

0 votes

Thanks Clément and bstefanescu

Clément, I tried your method but get a error message concerning the format (I didn't catch it in time)

bstefanescu, your method return me the following error when running the automation chain:

error occured while executing the chain 'ChainBonConges': Expected hash. Document['SchBonConges:date_start']?string evaluated instead to freemarker.core.BuiltIn$stringBI$BooleanFormatter on line 5, column 30 in @inline. Transaction failed

The difference with your recommendation is that I need to access a date that in my schema not dubin core one. I don't know if this make a difference or not so I tried replacing dc:modified by my schema name and properties.

Any guess ??

0 votes

Can you add the full stack trace? Can you also try to print only ${Document['SchBonConges:date_start']} without the ?string method to see what is printed? Also, make sure the prefix "SchBonConges" is the schema prefix and not the schema name (it may possibly work with the name too but the correct usage is to use the schema prefix)

When using SendMail operation it is easier if you use a message template instead of putting the mail content directly in the “message” argument. Using a mail template enable you to use freemarker and reuse your message in other operations. So create a new Mail Template and link it to the message attribute in your operation (click on the button at the right of the textarea) Then in your mail template you can write this for example:


This will print the dc:modified date of the document attached to the mail. The ?string.full method is a freemarker method that format the date. You can look here for more formatting options:

0 votes

Not tested but maybe you can try :

@{new java.text.SimpleDateFormat("yyyy-MM-dd").format(Document["SchemaName:date_start"].getTime())}
0 votes

SimpleDateFormat("yyyy-MM-dd").format(date) need a Date in parameter and not a Calendar, sorry.

Try : Document["SchemaName:date_start"].getTime()