Bill Run Advanced Filter - Built-in variables
Details on built-in variables used in the Bill Run Advanced Filter, including descriptions, formats, timezone handling, example values, and use cases.
The built-in variables are supported in Bill Run Advanced Filters when creating, editing, or viewing Bill Runs through the Zuora UI or the Zuora REST API. These variables help you define date-based filter conditions that are evaluated dynamically at runtime for Advanced Filters.
In the Zuora UI, these dynamic date variables are available in the filter configuration when you create or edit a Bill Run. In the Zuora REST API, you can also specify these variables in the Advanced Filters of a Bill Run request. If a Bill Run uses these variables, the selected values are displayed in the Filters section on the Bill Run Detail page.
{{BillRunDate}}
- Description
- Returns the date when the bill run was executed (started).
- Format
-
yyyy-MM-dd(for example,2024-06-15). - Timezone handling
- Converts the execution timestamp to the tenant’s configured timezone before extracting the date.
- Example values
-
- Executed at
2024-06-15 10:30:00 UTCwith tenant timezoneAmerica/Los_Angeles(UTC-7) returns2024-06-15. - Executed at
2024-06-15 02:00:00 UTCwith tenant timezoneAmerica/Los_Angelesreturns2024-06-14due to timezone offset.
- Executed at
- Use case
- Filter accounts or subscriptions based on when the bill run actually started. Useful for auditing or when filtering logic depends on the physical execution date.
{{TargetDate}}
- Description
- Returns the target date configured for the bill run. The target date determines the billing period end date for usage and recurring charges.
- Format
-
yyyy-MM-dd(for example,2024-06-30). - Timezone handling
- No timezone conversion. This is a date-only field stored as-is.
- Example values
-
-
2024-06-30(end of June) -
2024-12-31(end of year)
-
- Use case
- Filter accounts or subscriptions where a date custom field should be compared against the bill run’s target date. For example, filter accounts where
ContractEndDate__c <= {{TargetDate}}to only bill accounts whose contracts have not expired by the target date.
{{InvoiceDate}}
- Description
- Returns the invoice date configured for the bill run. This is the date that appears on generated invoices.
- Format
-
yyyy-MM-dd(for example,2024-06-15). - Timezone handling
- No timezone conversion. This is a date-only field stored as-is.
- Example values
-
2024-06-152024-07-01
- Use case
- Filter accounts or subscriptions based on the invoice date. For example, filter accounts where
BillingStartDate__c <= {{InvoiceDate}}to only include accounts that should start being billed by the invoice date.You can also use
{{InvoiceDate}}to bill only subscriptions that are due on the configured invoice date. For example, you can create a scheduled Bill Run that filters subscriptions where Next Renewal Date <={{InvoiceDate}}, ensuring that only records due for billing are processed at runtime.
{{AsRunDay}}
- Description
- Returns the day of the month from the bill run execution date, formatted for Bill Cycle Day (BCD) matching.
- Format
-
- For non–last-day executions: two-digit day (for example,
01,15,28) - For last-day executions: a comma-separated range from that day to 31 (for example,
28,29,30,31)
- For non–last-day executions: two-digit day (for example,
- Timezone handling
- Converts the execution timestamp to the tenant’s configured timezone before extracting the day.
- Example values
-
- If executed on June 15th:
15 - If executed on June 1st:
01 - If executed on February 28th (non-leap year, last day):
28,29,30,31 - If executed on April 30th (last day):
30,31
- If executed on June 15th:
- Use case
- Filter subscriptions by their Bill Cycle Day so that only subscriptions that should be billed on the current day are processed. For example,
Subscription.BillCycleDay__c eq {{AsRunDay}}.
{{Today}}
- Description
- Returns the current date at the time of evaluation. This is a framework-level variable that works in any generic filter context and is not specific to bill runs.
- Format
-
yyyy-MM-dd(for example,2024-06-15). - Timezone handling
- Converts the current system time to the tenant’s configured timezone before extracting the date.
- Example values
-
- If the current time is
2024-06-15 10:30:00 UTCand the tenant timezone isAmerica/Los_Angeles, the value returned is2024-06-15. - If the current time is
2024-06-15 02:00:00 UTCand the tenant timezone isAmerica/Los_Angeles, the value returned is2024-06-14.
- If the current time is
- Use case
- A general-purpose current-date variable for any filter. Unlike
{{BillRunDate}}, this always returns the actual current system date, making it suitable for non-bill-run contexts or when the real current date is required.
Supported built-in variables and operators
The following built-in date variables are available for use with any standard or custom date-type field in Advanced Filters:
{{BillRunDate}}{{TargetDate}}{{InvoiceDate}}{{Today}}
You can use these variables with comparison operators such as =, <, >, <=, >=, and <> to dynamically filter accounts, subscriptions, or charges.
Key Differences Summary
|
Variables |
Source |
Timezone Conversion |
Stability |
|---|---|---|---|
BillRunDate |
Bill run's |
Yes (tenant TZ) |
Stable across re-runs |
TargetDate |
Bill run's configured target date |
No |
Stable (configured value) |
InvoiceDate |
Bill run's configured invoice date |
No |
Stable (configured value) |
AsRunDay |
Bill run's |
Yes (tenant TZ) |
Stable across re-runs |
|
|
Current system time |
Yes (tenant TZ) |
Changes with time |