Skip to main content
Common encoded query components
Gary Ditsch avatar
Written by Gary Ditsch
Updated over 8 months ago

VividSheets allows you a lot of flexibility when you are creating encoded queries to use within a VividFunction. This flexibility is due to the absolute and relative cell referencing capabilities.

Learn more about using this syntax here: VividSheet Function Syntax

When creating the queries, you can get that information from a ServiceNow list, after using the condition builder. You can also obtain using the VividCharts condition builder within the preview query text box.

As users continue to build new sheets, the below components to those encoded queries are ones that are often used repeatedly.

On the last 30 days

ONLast 30 days@javascript:gs.beginningOfLast30Days()@javascript:gs.endOfLast30Days()

On the last 7 days

ONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()

On this month

ONThis month@javascript:gs.beginningOfThisMonth()@javascript:gs.endOfThisMonth()

On this year

ONThis year@javascript:gs.beginningOfThisYear()@javascript:gs.endOfThisYear()

Before {a date}

<javascript:gs.dateGenerate('2022-02-01','00:00:00')

On or before {a date}

<=javascript:gs.dateGenerate('2022-02-01','23:59:59')

After {a date}

>javascript:gs.dateGenerate('2023-07-04','23:59:59')

On or after {a date}

>=javascript:gs.dateGenerate('2023-07-04','00:00:00')

Between {two dates}

BETWEENjavascript:gs.dateGenerate('2024-01-01','00:00:00')@javascript:gs.dateGenerate('2024-02-29','23:59:59')

Between {a date} and today

BETWEENjavascript:gs.dateGenerate('2024-01-01','00:00:00')@javascript:gs.endOfToday()

Components to build an encoded query, for between two dates, where start date, end date, and year are separate cells.

BETWEENjavascript:gs.dateGenerate('{{ year reference }}{{ start date reference }}','00:00:00')@javascript:gs.dateGenerate('{{ year reference}}{{end date reference}}','23:59:59')

Did this answer your question?