View Template Structure

A view template has the following elements:

Element

Format

Description

viewTemplateName

String

The name of the view

type

Enum

system
Predefined system view template
custom
Custom view template

status

Enum

published
View templates in this status can be used for queries
draft
For use when designing the view template, before publication. Queries cannot be made against view templates in this status
deactivated
Queries cannot be made against view templates in this status

documentType

String

The type of transaction data this view template queries.

selectAttributes

Collection<String>

The fields that will be included in the response to queries using this view template.

Custom fields are supported. To specify a custom field, concatenate the prefix cus_ and the field name, as follows: cus_<fieldname>. For example, cus_mycustomfield.

filterExpressions

Collection<Object>

A collection of objects that defines filters for the view template. Each object contains name, field, op, anddefaultValue elements. For example:

{
"filterExpressions":[{
	"name":"myTimeCreated",
	"field":"TimeCreated",
	"op":"=",
	"defaultValue":"2017-01-01T00:00:00Z"
	}]
}
								

name

String

Element of a filter expression. A name given to this filter expression

field

String

Element of a filter expression. Specifies the field to which this filter expression applies

op

Enum

Element of a filter expression. The operator for the comparison to be performed in this filter expression. For a list of supported operators, see next table

defaultValue

Object

Element of a filter expression. A value to be applied to the filter expression in the absence of a request override

pagetoken

String

The initial query response contains up to 20 view template schemas, and a page token. To retrieve the next 20 view schemas, pass this page token as the value of the pagetoken parameter in a follow-up query.

Filter expressions can use the following operators:

Operator

Description

AND

The logical intersection operator. Documents must meet both specified criteria to be included in the results set.You can use APIs to perform the following reporting view template actions:

=

Arithmetic equality.

!=

Arithmetic inequality.

<>

Arithmetic inequality.

>

Greater than.

<

Less than.

>=

Greater than or equal.

<=

Less than or equal.

LIKE

Has pattern.

NOT LIKE

Does not have pattern.

IN

Similar to the SQL IN operator. The value must be included in a set of values.

NOT IN

Similar to the SQL NOT IN operator. The value must not be included in a set of values.

IS NULL

The field is null.

IS NOT NULL

The field is not null.