Courseiva
Platform Features and IntegrationmediumMultiple ChoiceObjective-mapped

SNOW-CAD Platform Features and Integration Practice Question

A developer is creating a REST API in ServiceNow to expose incident data. The API must return only incidents with 'state' = 2 (in progress) and limit results to 50. Which implementation is correct?

⚠ Common exam trap

Watch out — candidates often confuse the built-in table API's parameter syntax (which requires 'sysparm_query' for filters) with the GlideRecord method syntax, and assuming that 'gr.get()' can be used to filter multiple records when it is designed for single-record retrieval by key.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

In the script, use 'gr.addQuery('state', 2); gr.setLimit(50);' and return the records.

It uses the standard GlideRecord pattern to query the incident table with an 'addQuery' filter for state=2 and 'setLimit' to restrict results to 50, which is the proper server-side approach when building a custom REST API endpoint in a Scripted REST API or similar. The other options misuse table API syntax or GlideRecord methods in ways that would not work as intended.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the ServiceNow table API with endpoint '/api/now/table/incident?state=2&sysparm_limit=50'.

    Why it's wrong here

    The table API uses sysparm_query, not direct URL parameters.

  • In the script, use 'gr.addQuery('state', 2); gr.setLimit(50);' and return the records.

    Why this is correct

    This is the standard approach in a scripted REST API handler.

  • Use a REST API endpoint with path /api/incidents and set the query parameter 'sysparm_query=state=2' and 'sysparm_limit=50'.

    Why it's wrong here

    The sysparm_ prefix is used for table API, not for custom scripted REST APIs.

  • In the script, use 'gr.get('state', 2)' and then limit via 'gr.setLimit(50)'.

    Why it's wrong here

    gr.get() is for retrieving a single record by sys_id, not for queries.

About these practice questions

Courseiva writes every SNOW-CAD question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.