Commands

All of these commands are available to a template author via the Command Editor.

Listing of commands are alphabetic or by category. Commands are grouped into these categories: Conditional, Data Capture (Interview), Data Sources, Formatting Dates, Formatting Numbers, Formatting Strings, Miscellaneous, Post Merge, Repeating, Templates, and Variables.

Alphabetic

 

Command or Function Name Description and Examples
AlignCaptions Sets whether captions on the interview should be aligned left or right

<<AlignCaptions(Left)>>

<<AlignCaptions(Right)>>

BaseTemplate Base (or overlay) this template on another template

<<BaseTemplate(LetterHead)>>

<<BaseTemplate(headings:LetterHead,Destination)>>

Caption Set the caption for the data element on the interview screen

<<Caption(Amount,Capital amount of loan)>>

<<Caption(Amount,^bu^@Navy@Capital amount of loan)>>

CaptureAsLongText Capture a multi-line text values

<<CaptureAsLongText(Address,3)>>

CaptureDataElement Places a control for the data element on the interview screen

<<CaptureDataElement(Name)>>

<<CaptureDataElement(DateOfBirth,date)>>

CaptureLater Defer the capture of a data element to later in the interview

<<CaptureLater(Name)>>

ChooseFromData Choose from a data in the data source

<<ChooseFromData(IdOfOrder,Order/OrderID)>>

ChooseFromDataSource Choose a row from a data source

<<ChooseFromDataSource(Contacts,Choose a Contact,RefreshSave)>>

ChooseFromFile Choose data from a text or XML file

<<ChooseFromFile(Lookups:Contacts.xdtxt,Choose a contact,NoRefresh,Surname)>>

<<ChooseFromFile(Lookups:Contacts.xdtxt,Choose the Borrower,NoRefresh,BorrowerSurname,Borrower)>>

ChooseFromList Present the user with a list of choices in a drop down list

<<ChooseFromList(Province,Ontario,Quebec,British Columbia,Alberta,Manitoba,Saskatchewan,Nova Scotia,New Brunswick,Newfoundland and Labrador,Prince Edward Island)>>

<<ChooseFromList(Province,,Ontario,Quebec,'British Columbia', 'Alberta' ,Manitoba,Saskatchewan,Nova Scotia,New Brunswick,'Newfoundland and Labrador',Prince Edward Island)>>

ChooseFromRDBList Present a radio button list of choices

<<ChooseFromRDBList(Orientation,North,South,East,West)>>

<<ChooseFromRDBList(Clause,Security~~The undersigned undertakes to provide security covering the loan to be granted.,NoSecurity~~The undersigned is not required to provide security for the loan.)>>

<<ChooseFromRDBList(Clause,~~The undersigned undertakes to provide security covering the loan to be granted.,~~The undersigned is not required to provide security for the loan.)>>

ChooseFromSamples Presents a drop down list of choices, but the user can type their own if it is not in the list

<<ChooseFromSamples(Title,,Mr.,Mrs.,Miss,Ms.,Prof.,Dr.)>>

ChooseUsingCheckBox Choose a value using a check box

<<ChooseUsingCheckBox(RequiresSpecialSchooling,Yes,No,No)>>

<<ChooseUsingCheckBox(Clause,~~The Parties agree to cede their rights to various assets without prejudice.)>> <<If(Clause != '')>> <<Clause>> <<End()>>

ComeHereAfterRun Place a marker in the template where the cursor should be after the template has run.

<<ComeHereAfterRun()>>

Comment Places a comment into the template

<<Comment(Any arbitrary comments)>>

concat Concatenates any number of string values

<<SetV('FullName',concat(FirstNames,' ',Surname))>>

<<SetV('Possessive',concat(Noun,'!'s'))>>

contains Test for a substring inside another string

<<If(contains(Word,'q'))>>the word contains 'q'.<<End()>>

count Count – returns the number of a repeated item

<<If(count(Child) > 0)>>The number of children in the family is <<count(Child)>><<End()>>

<<If(count(Child) > 0)>>The names of the children follow:<<Foreach(Child)>><<Name>> <<Surname>><<End()>><<End()>>

<<count(Child[Age < 12])>>

CountOf Get the number of occurrences of one string inside another

<<CountOf('.',Name)>>

<<If(CountOf('.',Name) = 0)>>The name contains no initials.<<End()>>

CreateDataElement Create a data element in the template’s data set.

<<CreateDataElement('ThisDataElement',GetV('ThisVariable')>>

<<CreateDataElement('ThisFileName'),GetValidFileName(AccountNumber)>>

CurrencySymbol Insert the currency symbol as defined in the Regional Settings

<<CurrencySymbol()>>

Debug Debug missing or superfluous ‘end’ and ‘else’ issues

<<Debug()>>

Define Define the interview properties of a data element

<<Define(Amount,^biu^@Red@Caption text,|^b^@Navy@Heading text,Footing Text,Tab Caption,CaptureDataElement,,Required,Initial Value,hard;IsDigits;The amount must be numerics only.)?Enter the amount of the deal.>>

<<Define(Title,^biu^@Red@Title of the party,|^b^@Navy@PARTY DETAILS,,Contact Information,ChooseFromList,;Mr.;Mrs.;Ms.;Dr.;Prof.)>>

<<Define(TaxIncluded,Is Tax included,,,,ChooseUsingCheckBox,Y;N;N)>>

DocumentBody Insert the body of the originating template into the Base Template

<<DocumentBody>>

Dollars Render a numeric amount as a number of Dollars, in words

<<Dollars(Price)>>

<<Dollars(Price,'ToUpper')>>

DollarsFrancaise Render a numeric amount as a number of Dollars, in French words

<<DollarsFrancaise(Price)>>

<<DollarsFrancaise(Price,'ToLower')>>

EndsWith Test whether a string ends in a given string

<<If(EndsWith(Surname,'-Smith'))>>

EuroDeutsch Render a numeric amount as a number of Euros, in German words

<<EuroDeutsch(Price)>>

<<EuroDeutsch(Price,'ToLower')>>

EurosFrancaise Render a numeric amount as a number of Euros, in French words

<<EurosFrancaise(Price)>>

<<EurosFrancaise(Price,'ToLower')>>

ExcludeFromIV Excludes a data element from the capture interview for the template

<<ExcludeFromIV(FirmName)>>

<<ExcludeFromIV(FirmName,FirmAddressLine1,FirmAddressLine2,FirmPostalCode)>>

ExtractInitials Extract Initials from name

<<ExtractInitials(Fullnames,'.')>>

<<ExtractInitials(Fullnames,'')>>

Footing Place footing text below a data element in the interview

<<Footing(CompanyName,)>>

<<Footing(CompanyPostalCode,|^bu^@Navy@END OF COMPANY DETAILS)>>

ForEach Repeat for a number of repeating data elements

<<ForEach(Party)>> <<End()>>

<<ForEach(Party,Surname,ascending,text)>> <<End(for each)>>

<<ForEach(Child[Age < 12]) selects children whose age is less than 12>> <<End()>>

FormatDate Format a field as date and/or time

<<FormatDate(DateOfBirth,'yyyy/MM/dd','en')>>

FormatNumber Format Number

<<FormatNumber(Amount)>>

<<FormatNumber(Amount,'#,0.00;(#,0.00)')>>

<<FormatNumber(Amount,'#,0.00;(#,0.00)','FR')>>

GetListItem Extract a value from a delimited list

<<GetListItem(ListItem,'First,Second,Third',',')>>

<<GetListItem(4,IP_Address,'.')>>

<<GetListItem(GetV('element number'),PeriodicTable,',')>>

GetV Get the value of a variable

<<GetV('Balance')>>

GetValidFileName Get a string which only has valid file name characters

<<GetValidFileName(AccountNumber)>>

<<GetValidFileName(AccountNumber,'-')>>

<<CreateDataElement('TargetFileName',GetValidFileName(AccountNumber,'-'))>>

HardSpace Convert normal spaces to non-breaking spaces

<<HardSpace(Phrase)>>

<<HardSpace(Pounds(Price))>>

Heading Place heading text above a data element in the interview

<<Heading(CompanyName, COMPANY DETAILS)>>

<<Heading(CompanyName,|^bu^@Navy@COMPANY DETAILS)>>

Help Provide help text (to be shown in the Help area) for a data element

<<Help(Amount,Enter the amount of the loan)>>

If Conditionally include text into the document

<<If(Answer = 'No')>> <<End(If)>>

<<If(Answer = 'Yes')>>text when Answer is 'Yes'<<Else()>>text when Answer is not 'Yes'<<End(If)>>

<<If((Answer = 'Yes') or (Answer = 'Maybe') and (Amount > 500)>><<End()>>

<<If(position()= 1)>>This applies only to the first repeating item.<<End()>>

<<ForEach(Party)>><<PartyFullNames>><<If(last() > 1)>><<When(position() < last()-1,!, )>><<When(position() = last()-1, and )>><<End(party > 1)>><<End(for each)>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetV("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetV("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>><<RemoveParagraph()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>

IncludeDataSourceData Include data from a data source

<<IncludeDataSourceData(Contacts,RefreshSave,range=PostalCode > 8000,Customers)>>

IncludeFileData Include data from a text or XML file

<<IncludeFileData(Contacts.xml)>>

<<IncludeFileData(lookups:Contacts.xml,Refresh,Customers)>>

IncludeTemplate Include a template as part of this template

<<IncludeTemplate(utils:Clauses,Destination,ExcludeHeaders)>>

<<IncludeTemplate(utils:Clauses,Destination,IncludeHeaders)>>

IncludeTemplateText Include the bare text of a template as part of this template

<<IncludeTemplateText(layout:Help)>>

IncrementDate Increment a date

<<IncrementDate(DateOfBirth,1,'y')>>

<<IncrementDate('today',5,'d')>>

InsertFormattedText Insert text captured as long text

<<InsertFormattedText(Address)>>

InsertTemplate Insert a template whose name appears in a data element which is chosen by the user.

<<InsertTemplate(Clause,Destination)>>

<<InsertTemplate(concat('Clauses:',ChosenClauseName,PartyType),Destination)>>

<<InsertTemplate('Party Underage Clause',Destination)>>

<<InsertTemplate('letters:Covering Letter',Destination,PreserveHeaders)>>

InsertUnformattedLongText Inserts text captured as “long” text but with no line breaks or formatting

<<InsertUnformattedLongText(Address,', ')>>

InterviewIsWizard Specify whether the interview should be in Wizard form or not

<<InterviewIsWizard(Yes)>>

<<InterviewIsWizard(No)>>

InterviewTitle Set the title which will show on the Interview screen for this template

<<InterviewTitle(Custom Title for Interview Screen)>>

last Used in a ForEach to test whether the last repeating item is being referenced.

<<last()>>

<<If((position() > 1) and (position() < last()-1))>>, <<End()>><<If((position() > 1) and (position() = last()-1))>> and <<End()>>

List Produce a delimited list (e.g. commas and ‘and’) from repeating data

<<List(Party,Firstname Surname,!, , and )>>

<<List(Child[Age < 10],Firstname Surname,', ',' and ')>>

Max Gets the higher of two values

<<Max(HourlyRate * Hours, 1000)>>

<<Max(Age,CutoffAge)>>

MergeTemplate Supply the name of another template to be merged

<<MergeTemplate('Agreement')>>

<<MergeTemplate(concat('Agreement -',PartyType))>>

Min Gets the lower of two values

<<Min(HourlyRate * Hours, 1000)>>

<<Min(Age,CutoffAge)>>

Now Insert the current date (i.e. today) and/or time into the document

<<Now('yyyy/MM/dd')>>

<<Now('d MMMM yyyy HH:mm:ss','de')>>

NumberPhrase Format a number as words

<<NumberPhrase(Price)>>

<<NumberPhrase(Price - 100,'en-us','ToUpper')>>

NumberToCurrency Render a number as currency, in words

<<NumberToCurrency(Price, "Dollar", "Dollars", "cent", "cents", "", "en-uk", "Leave")>>

Ordinal Ordinal (i.e. First, Second,…) inside ForEach

<<Ordinal()>>

<<Ordinal(,Eerste,Tweede,Derde,Vierde,Fyfde,Sesde,Sewende,Agste en verdere)>>

position Get the position within a ForEach

<<When(position() > 1, and )>>

<<ForEach(Party)>><<PartyFullNames>><<If(last() > 1)>><<When(position() < last()-1,!, )>><<When(position() = last()-1, and )>><<End(party > 1)>><<End(for each)>>

Pounds Render a numeric amount as a number of Pounds, in words, UK English

<<Pounds(Price)>>

<<Pounds(Price,'ToUpper')>>

Rand Render a numeric amount as a number of Rand in words, in English

<<Rand(Price)>>

<<Rand(Price,'ToUpper')>>

RandAfrikaans Render a numeric amount as a number of Rand in words, Afrikaans

<<RandAfrikaans(Price)>>

<<RandAfrikaans(Price,'ToUpper')>>

RemoveParagraph Remove the paragraph after the template has merged.

<<RemoveParagraph()>>

RenderAsNumeric Force a string to be a valid numeric value

<<FormatNumber(RenderAsNumeric(Amount) * 1.10)>>

Replace Replace all occurrences of a specified string with another

<<Replace(EnglishSentence,'grey','gray')>>

<<Replace(Replace(Replace(EnglishSentence,'grey','gray'),'colour','color'),'favourite','favorite')>>

ReplaceField Replace a fillpoint in the Base Template

<<ReplaceField(Addressee)>><<ClientName>><<ReplaceFieldEnd()>>

<<ReplaceField(ToUpper(Addressee))>><<ToSentence(ClientName)>><<ReplaceFieldEnd()>>

Required Mark a data element as required – must have a non-empty value

<<Required(AccountNumber,Decimal)>>

<<Required(AccountNumber)>>

RequiredVersion Allows the template author to prevent a template running if the installed version of XpressDox is too low.

<<RequiredVersion(3.1.1)>>

RestrictToLicenses Supply licence serial numbers for this template

<<RestrictToLicenses(123,124,300)>>

round Round a value to the nearest integer

<<FormatNumber(round(Price))>>

Rule Applies a custom made validation rule to the data element in the interview process

<<Rule(Cost,hard,IsNumeric,110.00,12000.00,The Cost must be greater than 109 and less than or equal to 12000)>>

<<Rule(SellingPrice,hard,(Area > 1000 and SellingPrice > 500000) or (Area < 1001 and SellingPrice < 50001),'The SellingPrice must be greater than 500000 when the Area is more than 1000.')>>

<<Rule(IDNumber,hard,IsDigits,The IDNumber must consist only of digits)>><<Rule(IDNumber,hard,string-length(IDNumber) = 13,the IDNumber must be exactly 13 digits long)>>

<<Rule(IDNumber,hard,IsZAIDNumber,The IDNumber failed the test for a valid South African ID Number)>>

<<Rule(Email,hard,IsEmailAddress,'The field must be a valid email address')>><<Rule(Email,hard,(not(contains(Email,',')) and not(contains(Email,';'))),'not a list of addresses')>>

<<Rule(IDNumber,soft,1 = 1,'do you want to accept the value anyway?')>>

RunTemplates Specify a number of templates to be run when this template is run.

<<RunTemplates(CoveringLetter,Contract,Invoice,DebitOrder)>>

RunWordMacro Run a Word macro after the template has been merged.

<<RunWordMacro(MacroName)>>

<<RunWordMacro(FirstMacro,SecondMacro)>>

SaveAsPDF Specify that a merged document must be saved as PDF

<<SaveAsPDF(Also)>>

<<SaveAsPDF(Only)>>

<<SaveAsPDF(Not)>>

Script Define a chunk of document for re-use

<<Script(ProductDescription)>>chunk of text<<ScriptEnd()>>

SetCustomDocumentProperty Sets a custom document property in the merged document.

<<SetCustomDocumentProperty(MadeByXpressDox,Y)>>

SetDocumentName Set the document name (referenced as).

<<SetDocumentName(CoveringLetter)>>

SetInitialValue Sets the initial value for a data element that is to be captured

<<SetInitialValue(PostalCode,7890)>>

<<SetInitialValue(Customer/State,Washington)>>

SetMultipleDocumentFilter Sets a filter applying to the Document Per Repeated Item feature

<<SetMultipleDocumentFilter(ChildAge > 12)>>

<<SetMultipleDocumentFilter(ChildAge > ../AgeFilterValue)>>

SetSavedDataFileName Set the file name of the data that was captured in an interview for the template.

<<SetSavedDataFileName(Data )>>

SetSavedDataFolder Sets the folder where the data captured in the interview will be saved.

<<SetSavedDataFolder(Data )>>

SetSavedDocumentFileName Set the file name of the merged document.

<<SetSavedDocumentFileName()>>

SetSavedDocumentFolder Set the folder where the merged document will be saved.

<<SetSavedDocumentFolder(Docs )>>

SetSavedDocumentNameVersioning Set the option governing the versioning of the merged document file name (default is ON)

<<SetSavedDocumentNameVersioning(Off)>>

SetV Set a variable value

<<SetV('Balance',0)>>

<<SetV('Balance',GetV('Balance') + RenderAsNumeric(Amount))>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetV("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetV("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>><<RemoveParagraph()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>

SetVR Set a variable value and remove the paragraph

<<SetVR('Balance',0)>>

<<SetVr('Balance',GetV('Balance') + RenderAsNumeric(Amount))>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetVr("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetVR("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>

starts-with Test whether a value starts with a given string

<<If(starts-with(ProductName,'Microsoft'))>>Good quality inside<<End()>>

StartsWithVowel Test whether a string starts with a vowel

<<When(StartsWithVowel(Fruit),an,a)>>

<<When(StartsWithVowel(Accomodation,'Hh'),an,a)>>

string-length Returns the number of characters in a value

<<If(string-length(AddressLine3) > 0)>> <<AddressLine3>> <<End()>>

substring Extract a portion of a string

<<substring(Name,5)>>

<<substring(GetV('description'),1,string-length(GetV('name')))>>

substring-after Extract the substring after a given string

<<substring-after(Surname,'-')>>

substring-before Extract the substring before a given string

<<substring-before(Initials,'.')>>

sum Calculate the sum of values

<<FormatNumber(sum(InvoiceLine/Amount))>>

Tab Add a tab to the main panel of the interview screen

<<Tab(Financial Information,Capital,InterestRate,InterestDate,AmountPaid)>>

TableLookup Calculate a value from a table

<<TableLookup(CapitalAmount,'3001;56;0,5001;187;0,9999999;277;0')>>

<<TableLookup(AnnualIncome,'122500;0;18,195000;21960;25,270000;40210;30,999999999;143010;40')>>

ToLower Convert to lower case

<<ToLower(Name)>>

ToSentence Convert to Sentence case

<<ToSentence(Surname)>>

ToTitle Convert to Title Case

<<ToTitle(BookTitle)>>

ToUpper Convert to UPPER case

<<ToUpper(Name)>>

Trim Removes white space from either side of a string

<<FormatNumber(Trim(Amount))>>

UseScript Insert the contents of a script defined in another part of the template.

<<UseScript(ProductDescription)>>

When Provide condition for including small text values (e.g. for gender or plural handling)

<<When(Gender = 'M',he,she)>>

<<When(count(Child) = 1,child,children)>>

<<When(StartsWithVowel(Fruit),an,a)>> <<Fruit>>

WindowsLogonUser Returns the user name with which the current user logged on to Windows

<<WindowsLogonUser()>>

<<SetSavedDocumentFolder(Docs )>>

By Category

 


Conditional

Command or Function Name Description and Examples
contains Test for a substring inside another string

<<If(contains(Word,'q'))>>the word contains 'q'.<<End()>>

count Count – returns the number of a repeated item

<<If(count(Child) > 0)>>The number of children in the family is <<count(Child)>><<End()>>

<<If(count(Child) > 0)>>The names of the children follow:<<Foreach(Child)>><<Name>> <<Surname>><<End()>><<End()>>

<<count(Child[Age < 12])>>

EndsWith Test whether a string ends in a given string

<<If(EndsWith(Surname,'-Smith'))>>

If Conditionally include text into the document

<<If(Answer = 'No')>> <<End(If)>>

<<If(Answer = 'Yes')>>text when Answer is 'Yes'<<Else()>>text when Answer is not 'Yes'<<End(If)>>

<<If((Answer = 'Yes') or (Answer = 'Maybe') and (Amount > 500)>><<End()>>

<<If(position()= 1)>>This applies only to the first repeating item.<<End()>>

<<ForEach(Party)>><<PartyFullNames>><<If(last() > 1)>><<When(position() < last()-1,!, )>><<When(position() = last()-1, and )>><<End(party > 1)>><<End(for each)>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetV("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetV("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>><<RemoveParagraph()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>

starts-with Test whether a value starts with a given string

<<If(starts-with(ProductName,'Microsoft'))>>Good quality inside<<End()>>

StartsWithVowel Test whether a string starts with a vowel

<<When(StartsWithVowel(Fruit),an,a)>>

<<When(StartsWithVowel(Accomodation,'Hh'),an,a)>>

string-length Returns the number of characters in a value

<<If(string-length(AddressLine3) > 0)>> <<AddressLine3>> <<End()>>

When Provide condition for including small text values (e.g. for gender or plural handling)

<<When(Gender = 'M',he,she)>>

<<When(count(Child) = 1,child,children)>>

<<When(StartsWithVowel(Fruit),an,a)>> <<Fruit>>

Data Capture (Interview)

Command or Function Name Description and Examples
AlignCaptions Sets whether captions on the interview should be aligned left or right

<<AlignCaptions(Left)>>

<<AlignCaptions(Right)>>

Caption Set the caption for the data element on the interview screen

<<Caption(Amount,Capital amount of loan)>>

<<Caption(Amount,^bu^@Navy@Capital amount of loan)>>

CaptureAsLongText Capture a multi-line text values

<<CaptureAsLongText(Address,3)>>

CaptureDataElement Places a control for the data element on the interview screen

<<CaptureDataElement(Name)>>

<<CaptureDataElement(DateOfBirth,date)>>

CaptureLater Defer the capture of a data element to later in the interview

<<CaptureLater(Name)>>

ChooseFromData Choose from a data in the data source

<<ChooseFromData(IdOfOrder,Order/OrderID)>>

ChooseFromList Present the user with a list of choices in a drop down list

<<ChooseFromList(Province,Ontario,Quebec,British Columbia,Alberta,Manitoba,Saskatchewan,Nova Scotia,New Brunswick,Newfoundland and Labrador,Prince Edward Island)>>

<<ChooseFromList(Province,,Ontario,Quebec,'British Columbia', 'Alberta' ,Manitoba,Saskatchewan,Nova Scotia,New Brunswick,'Newfoundland and Labrador',Prince Edward Island)>>

ChooseFromRDBList Present a radio button list of choices

<<ChooseFromRDBList(Orientation,North,South,East,West)>>

<<ChooseFromRDBList(Clause,Security~~The undersigned undertakes to provide security covering the loan to be granted.,NoSecurity~~The undersigned is not required to provide security for the loan.)>>

<<ChooseFromRDBList(Clause,~~The undersigned undertakes to provide security covering the loan to be granted.,~~The undersigned is not required to provide security for the loan.)>>

ChooseFromSamples Presents a drop down list of choices, but the user can type their own if it is not in the list

<<ChooseFromSamples(Title,,Mr.,Mrs.,Miss,Ms.,Prof.,Dr.)>>

ChooseUsingCheckBox Choose a value using a check box

<<ChooseUsingCheckBox(RequiresSpecialSchooling,Yes,No,No)>>

<<ChooseUsingCheckBox(Clause,~~The Parties agree to cede their rights to various assets without prejudice.)>> <<If(Clause != '')>> <<Clause>> <<End()>>

Define Define the interview properties of a data element

<<Define(Amount,^biu^@Red@Caption text,|^b^@Navy@Heading text,Footing Text,Tab Caption,CaptureDataElement,,Required,Initial Value,hard;IsDigits;The amount must be numerics only.)?Enter the amount of the deal.>>

<<Define(Title,^biu^@Red@Title of the party,|^b^@Navy@PARTY DETAILS,,Contact Information,ChooseFromList,;Mr.;Mrs.;Ms.;Dr.;Prof.)>>

<<Define(TaxIncluded,Is Tax included,,,,ChooseUsingCheckBox,Y;N;N)>>

ExcludeFromIV Excludes a data element from the capture interview for the template

<<ExcludeFromIV(FirmName)>>

<<ExcludeFromIV(FirmName,FirmAddressLine1,FirmAddressLine2,FirmPostalCode)>>

Footing Place footing text below a data element in the interview

<<Footing(CompanyName,)>>

<<Footing(CompanyPostalCode,|^bu^@Navy@END OF COMPANY DETAILS)>>

Heading Place heading text above a data element in the interview

<<Heading(CompanyName, COMPANY DETAILS)>>

<<Heading(CompanyName,|^bu^@Navy@COMPANY DETAILS)>>

Help Provide help text (to be shown in the Help area) for a data element

<<Help(Amount,Enter the amount of the loan)>>

InterviewIsWizard Specify whether the interview should be in Wizard form or not

<<InterviewIsWizard(Yes)>>

<<InterviewIsWizard(No)>>

InterviewTitle Set the title which will show on the Interview screen for this template

<<InterviewTitle(Custom Title for Interview Screen)>>

Required Mark a data element as required – must have a non-empty value

<<Required(AccountNumber,Decimal)>>

<<Required(AccountNumber)>>

RequiredVersion Allows the template author to prevent a template running if the installed version of XpressDox is too low.

<<RequiredVersion(3.1.1)>>

Rule Applies a custom made validation rule to the data element in the interview process

<<Rule(Cost,hard,IsNumeric,110.00,12000.00,The Cost must be greater than 109 and less than or equal to 12000)>>

<<Rule(SellingPrice,hard,(Area > 1000 and SellingPrice > 500000) or (Area < 1001 and SellingPrice < 50001),'The SellingPrice must be greater than 500000 when the Area is more than 1000.')>>

<<Rule(IDNumber,hard,IsDigits,The IDNumber must consist only of digits)>><<Rule(IDNumber,hard,string-length(IDNumber) = 13,the IDNumber must be exactly 13 digits long)>>

<<Rule(IDNumber,hard,IsZAIDNumber,The IDNumber failed the test for a valid South African ID Number)>>

<<Rule(Email,hard,IsEmailAddress,'The field must be a valid email address')>><<Rule(Email,hard,(not(contains(Email,',')) and not(contains(Email,';'))),'not a list of addresses')>>

<<Rule(IDNumber,soft,1 = 1,'do you want to accept the value anyway?')>>

SetInitialValue Sets the initial value for a data element that is to be captured

<<SetInitialValue(PostalCode,7890)>>

<<SetInitialValue(Customer/State,Washington)>>

Tab Add a tab to the main panel of the interview screen

<<Tab(Financial Information,Capital,InterestRate,InterestDate,AmountPaid)>>

Data Sources

Command or Function Name Description and Examples
ChooseFromDataSource Choose a row from a data source

<<ChooseFromDataSource(Contacts,Choose a Contact,RefreshSave)>>

ChooseFromFile Choose data from a text or XML file

<<ChooseFromFile(Lookups:Contacts.xdtxt,Choose a contact,NoRefresh,Surname)>>

<<ChooseFromFile(Lookups:Contacts.xdtxt,Choose the Borrower,NoRefresh,BorrowerSurname,Borrower)>>

IncludeDataSourceData Include data from a data source

<<IncludeDataSourceData(Contacts,RefreshSave,range=PostalCode > 8000,Customers)>>

IncludeFileData Include data from a text or XML file

<<IncludeFileData(Contacts.xml)>>

<<IncludeFileData(lookups:Contacts.xml,Refresh,Customers)>>

Formatting Dates

Command or Function Name Description and Examples
FormatDate Format a field as date and/or time

<<FormatDate(DateOfBirth,'yyyy/MM/dd','en')>>

IncrementDate Increment a date

<<IncrementDate(DateOfBirth,1,'y')>>

<<IncrementDate('today',5,'d')>>

Now Insert the current date (i.e. today) and/or time into the document

<<Now('yyyy/MM/dd')>>

<<Now('d MMMM yyyy HH:mm:ss','de')>>

Formatting Numbers

Command or Function Name Description and Examples
CurrencySymbol Insert the currency symbol as defined in the Regional Settings

<<CurrencySymbol()>>

Dollars Render a numeric amount as a number of Dollars, in words

<<Dollars(Price)>>

<<Dollars(Price,'ToUpper')>>

DollarsFrancaise Render a numeric amount as a number of Dollars, in French words

<<DollarsFrancaise(Price)>>

<<DollarsFrancaise(Price,'ToLower')>>

EuroDeutsch Render a numeric amount as a number of Euros, in German words

<<EuroDeutsch(Price)>>

<<EuroDeutsch(Price,'ToLower')>>

EurosFrancaise Render a numeric amount as a number of Euros, in French words

<<EurosFrancaise(Price)>>

<<EurosFrancaise(Price,'ToLower')>>

FormatNumber Format Number

<<FormatNumber(Amount)>>

<<FormatNumber(Amount,'#,0.00;(#,0.00)')>>

<<FormatNumber(Amount,'#,0.00;(#,0.00)','FR')>>

GetListItem Extract a value from a delimited list

<<GetListItem(ListItem,'First,Second,Third',',')>>

<<GetListItem(4,IP_Address,'.')>>

<<GetListItem(GetV('element number'),PeriodicTable,',')>>

Max Gets the higher of two values

<<Max(HourlyRate * Hours, 1000)>>

<<Max(Age,CutoffAge)>>

Min Gets the lower of two values

<<Min(HourlyRate * Hours, 1000)>>

<<Min(Age,CutoffAge)>>

NumberPhrase Format a number as words

<<NumberPhrase(Price)>>

<<NumberPhrase(Price - 100,'en-us','ToUpper')>>

NumberToCurrency Render a number as currency, in words

<<NumberToCurrency(Price, "Dollar", "Dollars", "cent", "cents", "", "en-uk", "Leave")>>

Pounds Render a numeric amount as a number of Pounds, in words, UK English

<<Pounds(Price)>>

<<Pounds(Price,'ToUpper')>>

Rand Render a numeric amount as a number of Rand in words, in English

<<Rand(Price)>>

<<Rand(Price,'ToUpper')>>

RandAfrikaans Render a numeric amount as a number of Rand in words, Afrikaans

<<RandAfrikaans(Price)>>

<<RandAfrikaans(Price,'ToUpper')>>

round Round a value to the nearest integer

<<FormatNumber(round(Price))>>

sum Calculate the sum of values

<<FormatNumber(sum(InvoiceLine/Amount))>>

TableLookup Calculate a value from a table

<<TableLookup(CapitalAmount,'3001;56;0,5001;187;0,9999999;277;0')>>

<<TableLookup(AnnualIncome,'122500;0;18,195000;21960;25,270000;40210;30,999999999;143010;40')>>

Formatting Strings

Command or Function Name Description and Examples
CountOf Get the number of occurrences of one string inside another

<<CountOf('.',Name)>>

<<If(CountOf('.',Name) = 0)>>The name contains no initials.<<End()>>

ExtractInitials Extract Initials from name

<<ExtractInitials(Fullnames,'.')>>

<<ExtractInitials(Fullnames,'')>>

GetValidFileName Get a string which only has valid file name characters

<<GetValidFileName(AccountNumber)>>

<<GetValidFileName(AccountNumber,'-')>>

<<CreateDataElement('TargetFileName',GetValidFileName(AccountNumber,'-'))>>

HardSpace Convert normal spaces to non-breaking spaces

<<HardSpace(Phrase)>>

<<HardSpace(Pounds(Price))>>

InsertFormattedText Insert text captured as long text

<<InsertFormattedText(Address)>>

InsertUnformattedLongText Inserts text captured as “long” text but with no line breaks or formatting

<<InsertUnformattedLongText(Address,', ')>>

List Produce a delimited list (e.g. commas and ‘and’) from repeating data

<<List(Party,Firstname Surname,!, , and )>>

<<List(Child[Age < 10],Firstname Surname,', ',' and ')>>

RenderAsNumeric Force a string to be a valid numeric value

<<FormatNumber(RenderAsNumeric(Amount) * 1.10)>>

Replace Replace all occurrences of a specified string with another

<<Replace(EnglishSentence,'grey','gray')>>

<<Replace(Replace(Replace(EnglishSentence,'grey','gray'),'colour','color'),'favourite','favorite')>>

substring Extract a portion of a string

<<substring(Name,5)>>

<<substring(GetV('description'),1,string-length(GetV('name')))>>

substring-after Extract the substring after a given string

<<substring-after(Surname,'-')>>

substring-before Extract the substring before a given string

<<substring-before(Initials,'.')>>

ToLower Convert to lower case

<<ToLower(Name)>>

ToSentence Convert to Sentence case

<<ToSentence(Surname)>>

ToTitle Convert to Title Case

<<ToTitle(BookTitle)>>

ToUpper Convert to UPPER case

<<ToUpper(Name)>>

Trim Removes white space from either side of a string

<<FormatNumber(Trim(Amount))>>

WindowsLogonUser Returns the user name with which the current user logged on to Windows

<<WindowsLogonUser()>>

<<SetSavedDocumentFolder(Docs )>>

Miscellaneous

Command or Function Name Description and Examples
Comment Places a comment into the template

<<Comment(Any arbitrary comments)>>

Debug Debug missing or superfluous ‘end’ and ‘else’ issues

<<Debug()>>

RunTemplates Specify a number of templates to be run when this template is run.

<<RunTemplates(CoveringLetter,Contract,Invoice,DebitOrder)>>

SetMultipleDocumentFilter Sets a filter applying to the Document Per Repeated Item feature

<<SetMultipleDocumentFilter(ChildAge > 12)>>

<<SetMultipleDocumentFilter(ChildAge > ../AgeFilterValue)>>

Post Merge

Command or Function Name Description and Examples
RunWordMacro Run a Word macro after the template has been merged.

<<RunWordMacro(MacroName)>>

<<RunWordMacro(FirstMacro,SecondMacro)>>

SaveAsPDF Specify that a merged document must be saved as PDF

<<SaveAsPDF(Also)>>

<<SaveAsPDF(Only)>>

<<SaveAsPDF(Not)>>

SetCustomDocumentProperty Sets a custom document property in the merged document.

<<SetCustomDocumentProperty(MadeByXpressDox,Y)>>

SetDocumentName Set the document name (referenced as).

<<SetDocumentName(CoveringLetter)>>

SetSavedDataFileName Set the file name of the data that was captured in an interview for the template.

<<SetSavedDataFileName(Data )>>

SetSavedDataFolder Sets the folder where the data captured in the interview will be saved.

<<SetSavedDataFolder(Data )>>

SetSavedDocumentFileName Set the file name of the merged document.

<<SetSavedDocumentFileName()>>

SetSavedDocumentFolder Set the folder where the merged document will be saved.

<<SetSavedDocumentFolder(Docs )>>

SetSavedDocumentNameVersioning Set the option governing the versioning of the merged document file name (default is ON)

<<SetSavedDocumentNameVersioning(Off)>>

Repeating

Command or Function Name Description and Examples
ForEach Repeat for a number of repeating data elements

<<ForEach(Party)>> <<End()>>

<<ForEach(Party,Surname,ascending,text)>> <<End(for each)>>

<<ForEach(Child[Age < 12]) selects children whose age is less than 12>> <<End()>>

last Used in a ForEach to test whether the last repeating item is being referenced.

<<last()>>

<<If((position() > 1) and (position() < last()-1))>>, <<End()>><<If((position() > 1) and (position() = last()-1))>> and <<End()>>

Ordinal Ordinal (i.e. First, Second,…) inside ForEach

<<Ordinal()>>

<<Ordinal(,Eerste,Tweede,Derde,Vierde,Fyfde,Sesde,Sewende,Agste en verdere)>>

position Get the position within a ForEach

<<When(position() > 1, and )>>

<<ForEach(Party)>><<PartyFullNames>><<If(last() > 1)>><<When(position() < last()-1,!, )>><<When(position() = last()-1, and )>><<End(party > 1)>><<End(for each)>>

Templates

Command or Function Name Description and Examples
BaseTemplate Base (or overlay) this template on another template

<<BaseTemplate(LetterHead)>>

<<BaseTemplate(headings:LetterHead,Destination)>>

ComeHereAfterRun Place a marker in the template where the cursor should be after the template has run.

<<ComeHereAfterRun()>>

DocumentBody Insert the body of the originating template into the Base Template

<<DocumentBody>>

IncludeTemplate Include a template as part of this template

<<IncludeTemplate(utils:Clauses,Destination,ExcludeHeaders)>>

<<IncludeTemplate(utils:Clauses,Destination,IncludeHeaders)>>

IncludeTemplateText Include the bare text of a template as part of this template

<<IncludeTemplateText(layout:Help)>>

InsertTemplate Insert a template whose name appears in a data element which is chosen by the user.

<<InsertTemplate(Clause,Destination)>>

<<InsertTemplate(concat('Clauses:',ChosenClauseName,PartyType),Destination)>>

<<InsertTemplate('Party Underage Clause',Destination)>>

<<InsertTemplate('letters:Covering Letter',Destination,PreserveHeaders)>>

MergeTemplate Supply the name of another template to be merged

<<MergeTemplate('Agreement')>>

<<MergeTemplate(concat('Agreement -',PartyType))>>

ReplaceField Replace a fillpoint in the Base Template

<<ReplaceField(Addressee)>><<ClientName>><<ReplaceFieldEnd()>>

<<ReplaceField(ToUpper(Addressee))>><<ToSentence(ClientName)>><<ReplaceFieldEnd()>>

RestrictToLicenses Supply licence serial numbers for this template

<<RestrictToLicenses(123,124,300)>>

Script Define a chunk of document for re-use

<<Script(ProductDescription)>>chunk of text<<ScriptEnd()>>

UseScript Insert the contents of a script defined in another part of the template.

<<UseScript(ProductDescription)>>

Variables

Command or Function Name Description and Examples
concat Concatenates any number of string values

<<SetV('FullName',concat(FirstNames,' ',Surname))>>

<<SetV('Possessive',concat(Noun,'!'s'))>>

CreateDataElement Create a data element in the template’s data set.

<<CreateDataElement('ThisDataElement',GetV('ThisVariable')>>

<<CreateDataElement('ThisFileName'),GetValidFileName(AccountNumber)>>

GetV Get the value of a variable

<<GetV('Balance')>>

RemoveParagraph Remove the paragraph after the template has merged.

<<RemoveParagraph()>>

SetV Set a variable value

<<SetV('Balance',0)>>

<<SetV('Balance',GetV('Balance') + RenderAsNumeric(Amount))>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetV("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetV("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>><<RemoveParagraph()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>

SetVR Set a variable value and remove the paragraph

<<SetVR('Balance',0)>>

<<SetVr('Balance',GetV('Balance') + RenderAsNumeric(Amount))>>

<<ChooseFromRDBList(Gender,Male,Female)>><<If(Gender = "Male")>><<SetVr("PronounHe","he")>><<Setv("PronounHim","him")>><<SetV("PronounHis","his")>><<Else()>><<SetVR("PronounHe","she")>><<SetV("PronounHim","her")>><<SetV("PronounHis","her")>><<End()>> <<GetV('PronounHe')>> took <<GetV('PronounHis')>> bag with <<GetV('PronounHim')>>