Question 467 of 500
Platform Features and IntegrationmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct implementation uses gr.addQuery('state', 2) and gr.setLimit(50) within the GlideRecord script. This is the proper server-side approach because addQuery applies a direct database filter to the incident table, ensuring only records with state equal to 2 (in progress) are retrieved, while setLimit restricts the result set to 50 records before any processing occurs. On the ServiceNow Certified Application Developer CAD exam, this question tests your understanding of GlideRecord fundamentals within a custom REST API endpoint, specifically that filtering must happen on the query object, not after retrieval or through table API parameters. A common trap is confusing client-side filtering with server-side GlideRecord methods, or misusing sysparm_query in a scripted API where it has no effect. Remember the memory tip: “Query first, limit second” — always chain addQuery before setLimit on the GlideRecord object to enforce efficient, server-side data restriction.

SNOW-CAD Platform Features and Integration Practice Question

This SNOW-CAD practice question tests your understanding of platform features and integration. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

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?

Question 1mediummultiple choice
Full question →

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.

Option B is correct because 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.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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.

    Related concept

    Read the scenario before looking for a memorised answer.

  • 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.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is confusing 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.

Detailed technical explanation

How to think about this question

When building a custom REST API in ServiceNow, the GlideRecord object's 'addQuery' method builds an encoded query that is applied server-side, while 'setLimit' caps the result set before any client-side processing, ensuring efficient data retrieval. The table API ('/api/now/table/') is a built-in REST endpoint that automatically parses 'sysparm_query' and 'sysparm_limit' parameters, but it exposes the entire table unless ACLs restrict it, whereas a custom scripted API allows granular control over business logic and security.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related SNOW-CAD practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SNOW-CAD practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SNOW-CAD question test?

Platform Features and Integration — This question tests Platform Features and Integration — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: In the script, use 'gr.addQuery('state', 2); gr.setLimit(50);' and return the records. — Option B is correct because 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.

What should I do if I get this SNOW-CAD question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.