...
ROUND(): Rounds a number to the nearest specified number of decimal places.
ROUNDUP(): Rounds a number up to the nearest specified number of decimal places.
ROUNDDOWN(): Rounds a number down to the nearest specified number of decimal places.
Contact Phone Property Access
Access contact phone-related properties using the new array properties: phoneNumber
, phoneType
, and phoneExtension
. You can now access these properties directly without using array notation.
For example, instead of CONTACT.phoneNumber[0]
, you can use CONTACT.phoneNumber
or first(CONTACT.phoneNumber)
.
To display a "home" phone number, use the following formula:
Code Block |
---|
lookup(`CONTACT`.phoneType=='Home', `CONTACT`.phoneNumber) |
The phones
property is deprecated. Replace any references to phones
with phoneNumber
, phoneType
, or phoneExtension
in your formulas.
Formatting Dates
Date formats control how dates are displayed. The FORMAT() function enables formatting dates according to various styles.
...
This guide provides a foundational understanding of formulas in Windsor applications. For more in-depth explanations and advanced topics, please consult additional resources or seek guidance from experienced Windsor users.
Time/Date Duration Calculation
For Days:
Code Block |
---|
// Days
floor(dateDiff(date(formatDate(`ANTICIP_STRT_DT`,'ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_STRT_TM`, true),'HH:mm:ss [GMT]ZZ'), true),date(formatDate(`ANTICIP_END_DT`,'ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_END_TM`, true),'HH:mm:ss [GMT]ZZ'), true),'hours')/24) + ' day(s)' + ' ' |
For Hours:
Code Block |
---|
iff(formatDate(`ANTICP_END_TM`,'HH:mm:ss')<'12:00:00',
// Hours - when AM is after PM
dateDiff(date(formatDate('01/01/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_STRT_TM`, true),'HH:mm:ss [GMT]ZZ'), true),date(formatDate('01/02/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_END_TM`, true),'HH:mm:ss [GMT]ZZ'), true),'hours') + ' hour(s)' + ' '
,
// Hours - when PM is after AM
dateDiff(date(formatDate('01/01/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_STRT_TM`, true),'HH:mm:ss [GMT]ZZ'), true),date(formatDate('01/01/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_END_TM`, true),'HH:mm:ss [GMT]ZZ'), true),'hours') + ' hour(s)' + ' '
) |
For Minutes:
Code Block |
---|
// Minutes
(dateDiff(date(formatDate('01/01/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_STRT_TM`, true),'HH:mm:ss [GMT]ZZ'), true),date(formatDate('01/02/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_END_TM`, true),'HH:mm:ss [GMT]ZZ'), true),'minutes') - 60*dateDiff(date(formatDate('01/01/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_STRT_TM`, true),'HH:mm:ss [GMT]ZZ'), true),date(formatDate('01/02/2001','ddd MMM DD YYYY') + ' ' + formatDate(date(`ANTICP_END_TM`, true),'HH:mm:ss [GMT]ZZ'), true),'hours')) + ' minute(s)' |
...
Simple Conditional Formula Examples
...