Value properties in DOCX, XLSX and PPTX templates

You can access different methods and properties on tag values. For example, you can bring a string to the lowercase, get a day, month or year from a date, get a number of items in an array.

Value properties work the same in DOCX, XLSX and PPTX templates.

Just use dot after tag value as in the example below:

Template

Data

Result

{{stringVal.ToLower}}
{{dateVal.Year}}
{{arrayVal.Length}}
{
    "stringVal": "Jessica Adams",
    "dateVal": "2012-04-21T18:25:43-05:00",
    "arrayVal": [ 1, 2, 3, 4, 5],
}
jessica adams
2012
5

There are three possible types of values you can call properties on. You can find the list of properties for each of them below:

String

Length - gets the number of characters in the current String object.

ToLower - returns a copy of this string converted to lowercase.

ToUpper - returns a copy of this string converted to uppercase.

Trim - removes all leading and trailing white-space characters from the current String object.

GetHashCode - returns the hash code for this string.(Overrides Object.GetHashCode().)

Date and time

Date - the date component without time.

Day - the day of the month.

DayOfWeek - the day of the week.

DayOfYear - the day of the year.

Hour - the hour component of the date.

Millisecond - the milliseconds component of the date.

Minute - the minute component of the date.

Month - the month component of the date.

Second - the seconds component of the date.

Ticks - the number of ticks that represent the date and time.

TimeOfDay - the time of day for this instance.

Year - the year component of the date.

GetHashCode - returns the hash code for this date.

ToLongDateString - converts the value of the current DateTime object to its equivalent long date string representation.

ToLongTimeString - converts the value of the current date and time object to its equivalent long time string representation.

ToOADate - converts the value of this instance to the equivalent OLE Automation date.

ToShortDateString - converts the value of the current date and time object to its equivalent short date string representation.

ToShortTimeString - converts the value of the current date and time object to its equivalent short time string representation.

IsDaylightSavingTime - indicates whether this instance of date and time is within the daylight saving time range for the current time zone.

ToFileTime - converts the value of the current DateTime object to a Windows file time.

ToFileTimeUtc - converts the value of the current DateTime object to a Windows file time.

Array

Length - gets the total number of elements in all the dimensions of the array.