SNOW-CAD Platform Features and Integration Practice Question
An organization has a ServiceNow instance that integrates with a third-party monitoring tool using a webhook. The monitoring tool sends HTTP POST requests to a Scripted REST API in ServiceNow to create incidents automatically. Recently, the monitoring tool started sending duplicate requests due to a retry mechanism. The developer wants to ensure that duplicate incidents are not created. The Scripted REST API currently creates a new incident record for every request without checking for duplicates. The request payload includes a unique 'alert_id' field. The developer decides to implement idempotency logic. Which approach should the developer use to prevent duplicate incident creation?
⚠ Common exam trap
Candidates often choose Option C (business rule) thinking it centralizes duplicate logic, but they overlook that the business rule runs after the insert attempt, not before the API call, so it cannot prevent the duplicate request from being processed or the API from returning a success response for the duplicate.
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 Scripted REST API, use a GlideRecord to query the incident table with a condition on the 'alert_id' field before inserting a new record; if a record exists, skip creation and return the existing record's sys_id
It implements idempotency directly within the Scripted REST API by querying the incident table using GlideRecord with a condition on the unique 'alert_id' field before inserting. If a record with that 'alert_id' already exists, the API skips creation and returns the existing sys_id, ensuring no duplicate incidents are created despite duplicate webhook requests.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
In the Scripted REST API, use a GlideRecord to query the incident table with a condition on the 'alert_id' field before inserting a new record; if a record exists, skip creation and return the existing record's sys_id
Why this is correct
This is the simplest and most effective idempotency check within the same API script.
- ✗
Create a GlideAggregate script that counts incidents with the same 'alert_id'; proceed only if count is zero
Why it's wrong here
GlideAggregate is for counting, but the race condition exists; also it's not atomic.
- ✗
Add a before-insert business rule on the incident table that checks for duplicates using the 'alert_id' field
Why it's wrong here
Business rules run on all inserts, adding unnecessary overhead, and may still allow duplicates if concurrent.
- ✗
Use a flow in Flow Designer triggered by the REST API that creates an incident only if the 'alert_id' is not already present in a custom table
Why it's wrong here
A Flow Designer flow cannot be directly triggered by an inbound HTTP POST request targeting a Scripted REST API, rendering this approach technically unfeasible for the initial integration point. The idempotency logic, including checking the 'alert_id' in a custom table, must reside within the Scripted REST API script itself to process the request directly. However, Flow Designer is highly effective for orchestrating complex workflows and conditional record creation, and could be used to process data *after* it has been received and potentially staged by the Scripted REST API, or for other record-based triggers.
Go deeper
Related to this question
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 →
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.