IS_WITHIN_LAST_DAYS
IS_WITHIN_LAST_DAYS:
arg: { arg } # required
offsetDays: { offsetDays } # required
Description
The IS_WITHIN_LAST_DAYS
operation checks if a DateTime
value, provided as the argument arg
, falls within the last number of days (offsetDays
) including today. The comparison is based on the current date at UTC midnight. It returns a Boolean
value: true
if the arg
DateTime is within the last offsetDays
, and false
otherwise.
Parameters
-
arg
(Operation<DateTime
>, required):- Specifies the
DateTime
value to be checked. - This can be any operation that resolves to a
DateTime
value, such asFIELD
,EXTRACT
,DATE_TIME_FROM
, etc.
- Specifies the
-
offsetDays
(number, required):- Specifies the number of days to define the "last days" range, including today.
- Must be a non-negative integer.
Return Type
Examples
-
Checking if a last login date is within the last 7 days:
IS_WITHIN_LAST_DAYS:
arg:
FIELD:
path: CA10__lastLoginDate__c # Assume this field returns a DateTime value
offsetDays: 7This example checks if the date in the
CA10__lastLoginDate__c
field is within the last 7 days, including today. -
Using
IS_WITHIN_LAST_DAYS
in a Condition:- status: COMPLIANT
currentStateMessage: "The user has logged in recently (within the last 30 days)."
check:
IS_WITHIN_LAST_DAYS:
arg:
EXTRACT: CA10__lastLogin__c # Assume 'CA10__lastLogin__c' is an extract returning DateTime
offsetDays: 30This condition flags a resource as
COMPLIANT
if the last login date, obtained from theCA10__lastLogin__c
extract, is within the last 30 days.
See more details in: