RenderTypes
This document is intended for ServiceNow / Squid administrators wanting to understand how Squid works or creating custom configurations.
Accessing Squid as a data consumer does not require reading this document!
While References and Relations define what is to be rendered, RenderTypes define how that data is rendered.
RenderTypes have an impact on
- the rendered JSON and with that what data is returned as well as how that data is structured.
- the database load (some RenderTypes can cause exponentially more database queries).
- your retrieved entities count. Some RenderTypes count toward your licensed entities limit.
Defining how to render references is straightforward. We have the following options:
SysId- Render just theSysId.Reference- Render the referenced entity as well.Inline Content- Render the referenced entity inline.Literal- Render the value of the reference field.Display Value- Render the referenced entity via ServiceNow's Display Value.Disable- Exclude the reference from the output.
Relations have other options that mirror those for references. Relations can additionally define where and when a relation is rendered. We have these options:
RenderTypes starting with Relation*. These render the relation in the dedicated relations section of returned JSON.
Relation SysId- Render the relation with just theSysIdof the target.Relation Reference- Render the relation with the target entity rendered as reference.Relation Inline Content- Render the relation with the target entity rendered inline.Relation Literal- Render the relation with the value of the target field.Relation Display Value- Render the relation with the target entity via ServiceNow's Display Value.
and RenderTypes starting with Inline*. These render the relation inline with the referencing entity.
Inline SysId- Render the relation inline with just theSysIdof the target.Inline Reference- Render the relation inline with the target entity rendered as reference.Inline Content- Render the relation inline with the target entity rendered inline.Inline Literal- Render the relation inline with the value of the target field.Inline Display Value- Render the relation inline with the target entity via ServiceNow's Display Value.
Quick Decision Guide for References
For details see RenderTypes Reference.
| Use Case | RenderType |
|---|---|
| Only need the sys_id | SysId |
| Bulk export with referenced data | Reference |
| Single entity, self-contained JSON | Inline Content |
| Field value already is the required value | Literal |
| Render ServiceNow displayValue | Display Value |
| Exclude a reference from output | Disable |
Quick Decision Guide for Relations
For details see RenderTypes Relations.
First, decide where the relation should be rendered:
| Requirement | Use RenderTypes starting with... |
|---|---|
| Bulk export, optimized performance | Relation* |
| Single entity, self-contained JSON | Inline* |
Then, decide what data to render:
Relation* RenderTypes
These render in the relations section.
| Use Case | RenderType |
|---|---|
| Only need sys_id, no entity data | Relation SysId |
| Bulk export with full entity details (recommended) | Relation Reference |
| M-to-N relation, field value is what you need | Relation Literal |
| Human-readable display names (locale-dependent) | Relation Display Value |
Inline* RenderTypes
These render inline with the referencing entity and require Allow Inline Relations on the requested configuration.
| Use Case | RenderType |
|---|---|
| Self-contained JSON, only need sys_id | Inline SysId |
| Self-contained JSON with full entity details | Inline Reference |
| Single entity request, fully nested JSON | Inline Content |
| M-to-N relation, field value inline | Inline Literal |
| Human-readable display names inline (locale-dependent) | Inline Display Value |
For bulk data exports, prefer Relation Reference over any Inline*
RenderType.
Inline* RenderTypes cause additional SQL queries per entity and should be reserved for single-entity
requests.