Calculated Field
Calculated Field
A calculated Field represents a field that can be used to perform arithmetic operations and string concatenation using built-in functions. These actions can be executed on process fields, static values or case variables.
1. To use process fields type the field name or field id and then use the autocomplete feature.
2. To use string static values apply quotation marks.
3. Allowed Operation: +, -, /, *
4. Built-in Functions
1) Date Functions:
GetDate() - Returns current date
ConvertDateToInt(Format) - The function converts the time now into int format, we must give as a parameter the format of the number you will return.
yyyyMMddHHmmss - returns year, month,day,hour,minute,second
yyyyMMddHHmm - returns year, month,day,hour,minute
yyyyMMddHH - returns year, month,day,hour
yyyyMMdd - returns year, month,day
yyyyMM - returns year, month
DatePart(Date, Part) - Returns Part of a chosen Date. The date can be a static value or a dynamic value from another field value.
To get the year use "yyyy".Example: DatePart(Date,"yyyy")
To get the month use "MM".Example: DatePart(Date,"MM")
To get the day use "dd".Example: DatePart(GetDate(),"dd")
To get the name of the month and the year use "y". Example: DatePart(GetDate(),"y")
GetDateFormat(format) - Returns current date in specified format
GetDateFormat("yyyy-MM-dd HH:mm:ss") Example: 2022-08-21 22:13:22
GetDateFormat("yyyy-MM-dd") Example: 2022-08-21
GetDateFormat("dd-MM-yyyy") Example: 21-08-2022
GetDateFormat("MM-dd-yy") Example: 08-21-22
GetDateFormat("MM-dd-yyyy") Example: 08-21-2022
DateAdd(Date, days) - This function adds a specified number of days (as a signed integer) to a specified date value, and then returns that modified value.
"Date" parameter represents a date type value that can be obtained from a process field or static value.
"days" parameter represents a numeric value that indicates the number of days to be added to the first parameter.
DateDiff(Date1, Date2, Format) - Calculates the difference between two dates, startdate(Date1) and enddate(Date2) in days, months or years.
To calculate the difference in years add 'y' value. Example: DateDiff(DateField1, DateField2, 'y')
To calculate the difference in months add 'm' value. Example: DateDiff(DateField1, DateField2, 'm')
To calculate the difference in days add 'd' or any other value. Example: DateDiff(DateField1, DateField2, 'd')
2) User Related Functions
GetCurrentUser() Returns logged in user UserName.
GetNameForCurrentUser() Returns logged in user Name.
GetLastNameForCurrentUser() Returns logged in user LastName.
GetEmailForCurrentUser() Returns logged in user e-mail.
GetDefaultInstanceForCurrentUser() Returns logged in user DefaultInstance.
GetDefaultSiteForCurrentUser() Returns logged in user DefaultSite.
3) Client Related Functions
GetProcessClientFirstName() Returns client FirstName.
GetProcessClientLastName() Returns client LastName.
GetProcessClientFullName() Returns client FullName.
GetProcessClientEmail() Returns client e-mail.
GetProcessClientAddress() Returns client Address.
GetProcessClientPhoneNumber() Returns client PhoneNumber.
GetProcessClientCif() Returns client Cif.
GetProcessClientCompanyName() Returns client CompanyName.
GetProcessClientCategory() Returns client Category.
GetProcessClientSubCategory() Returns client SubCategory.
GetProcessClientFeature1() Returns client Feature1.
GetProcessClientFeature2() Returns client Feature2.
GetProcessClientFeature3() Returns client Feature3.
4) Number Functions
ConvertToInt() Converts the specified string representation of a number.
MaxNumber(Number1, Number2) Returns the larger of the two specified numbers.
MinNumber(Number1, Number2) Returns the smaller of the two specified numbers.
5) Other
GenerateGUID(length, type) Return Guid only when a case created.
"length" parameter represents length of GUID.
"type" parameter represents type of GUID.
Example : GenerateGUID(10, "number") 1183141715
Example : GenerateGUID(36, "text") fa576b76-51ea-47d7-9b51-fc233bf0ceb6