IS_WITHIN_NEXT_DAYS
IS_WITHIN_NEXT_DAYS:
arg: { arg } # required
offsetDays: { offsetDays } # required
Description
The IS_WITHIN_NEXT_DAYS operation checks if a DateTime value, provided as the argument arg, falls within the next 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 next offsetDays, and false otherwise.
Parameters
-
arg(Operation<DateTime>, required):- Specifies the
DateTimevalue to be checked. - This can be any operation that resolves to a
DateTimevalue, such asFIELD,EXTRACT,DATE_TIME_FROM, etc.
- Specifies the
-
offsetDays(number, required):- Specifies the number of days to define the "next days" range, including today.
- Must be a non-negative integer.
Return Type
Examples
-
Checking if a certificate expiration date is within the next 14 days:
IS_WITHIN_NEXT_DAYS:
arg:
FIELD:
path: CA10__certificateExpiryDate__c # Assume this field returns a DateTime value
offsetDays: 14This example checks if the date in the
CA10__certificateExpiryDate__cfield is within the next 14 days, including today. -
Using
IS_WITHIN_NEXT_DAYSin a Condition:- status: INCOMPLIANT
currentStateMessage: "The certificate is expiring soon (within the next 30 days)."
remediationMessage: "Renew the certificate to avoid service disruption."
check:
IS_WITHIN_NEXT_DAYS:
arg:
EXTRACT: CA10__certExpiration__c # Assume 'CA10__certExpiration__c' is an extract returning DateTime
offsetDays: 30This condition flags a resource as
INCOMPLIANTif its certificate expiration date, obtained from theCA10__certExpiration__cextract, is within the next 30 days.
See more details in: