{% extends 'admin/master.html' %} {% block body %}

ServiceNow Query

Query the table of a ServiceNow account the same way the import reads it — with the connection, query and field list of the account. The result shows every field a record really has and which name the object would be imported under, so a wrong login, an empty query or the wrong hostname field become visible. Nothing is written: neither ServiceNow nor the syncer's objects are changed here.

{% if not accounts %}
No enabled ServiceNow account found. Create one first.
{% endif %}
One table. The account's own tables are offered here.
In front of /table/<name>.
The field the object name comes from.
Encoded query, e.g. operational_status=1. Empty asks for every record.
Comma separated. Empty asks for every field of the found records.
false shows the sys_ids instead.
{% if error %}
{{ error }}
{% endif %} {% if result %}

Used request: {{ result.url }}
{% for key, value in result.params.items() | sort %} {{ key }}={{ value }}{% if not loop.last %}, {% endif %} {% endfor %}

{% if result.limits %}

Rate limit of the instance: {% for key, value in result.limits.items() | sort %} {{ key }}: {{ value }}{% if not loop.last %}, {% endif %} {% endfor %}

{% endif %}
{{ result.records | length }} record(s) found {% if result.records | length >= limit %} limit reached {% endif %}
{% if not result.records %}

Nothing found. Empty the query, check the table name, or make sure the account's user may read the table.

{% else %} {% for record in result.records %}
{% if record.hostname %} {{ record.hostname }} would be imported {% else %} no hostname field would be skipped {% endif %} {{ record.labels | length }} field(s)
{% for key, value in record.labels.items() | sort %} {% endfor %}
{{ key }} {%- if value -%}{{ value }} {%- else -%} empty on this record {%- endif -%}
{% endfor %} {% endif %}
{% endif %}
{% endblock %}