Salesforce-Marketing-Cloud-Engagement-Developer Practice Test

Salesforce Spring 25 Release -
Updated On 1-Jan-2026

196 Questions

A developer wants to design a custom subscription center in CloudPages. The developer prefers to code in AMPscript, but is also skilled in Server-Side JavaScript. While the developer is confident their code is of high quality, they would still like to handle unexpected errors gracefully to ensure the best user experience. Which feature should handle this scenario?

A. Wrapping the code in a Server-Side JavaScript Try/Catch block

B. Using RaiseError AMPscript function when an error occurs

C. Marketing Cloud automatically handles any error scenario that may occur

D. Wrapping thecode in a AMPscript HandleError block

A.   Wrapping the code in a Server-Side JavaScript Try/Catch block

Explanation:

A. Wrapping the code in a Server-Side JavaScript Try/Catch block ✅ (Correct Answer)
✅ Server-Side JavaScript (SSJS) in Salesforce Marketing Cloud supports standard JavaScript error handling using try/catch blocks. This allows the developer to gracefully catch and handle unexpected exceptions, such as failed lookups, API errors, or null references. When an error occurs inside a try block, control immediately jumps to the catch block where the developer can log the error, notify the user with a friendly message, or take alternative action. This is a best practice when using SSJS for robust and fault-tolerant solutions.

B. Using RaiseError AMPscript function when an error occurs ❌
❌ The RaiseError AMPscript function is used to explicitly trigger an error during code execution. While it can be helpful for stopping execution when a known issue is detected, it does not handle errors gracefully—in fact, it halts processing altogether. It's useful for validation and debugging but not ideal for user-facing error handling. It does not provide the same structured control flow that try/catch offers in SSJS for catching unexpected errors and continuing execution or displaying friendly feedback.

C. Marketing Cloud automatically handles any error scenario that may occur ❌
❌ Marketing Cloud does not automatically handle all error scenarios in CloudPages or AMPscript/SSJS execution. If an error occurs, it may result in a broken page, failed script execution, or a generic error message to the user, which negatively impacts user experience. Developers must implement their own error handling logic to catch and address issues in a user-friendly way. Relying solely on the platform to handle errors is not a best practice and may lead to poor reliability and user dissatisfaction.

D. Wrapping the code in a AMPscript HandleError block ❌
❌ AMPscript does not have a HandleError block or built-in structured error handling syntax like try/catch in SSJS. AMPscript functions often return null or fail silently if something goes wrong, so developers need to manually check for conditions or use fallback values. There is no formal block to catch and handle exceptions in AMPscript. If robust error handling is required, SSJS is generally preferred for scenarios where exception management is needed.

A developer is building an integration with the Marketing Cloud API. In which two ways should the Client ID and Client Secret credentials be stored? (Choose 2)

A. Set credentials as environment variables in the application platform

B. Pass credentials in URL parameters over HTTPS

C. Set credentials as variables in application source code

D. Store credentials in a key management system (KMS)

A.   Set credentials as environment variables in the application platform
D.   Store credentials in a key management system (KMS)

Explanation:

A. Set credentials as environment variables in the application platform ✅ (Correct Answer)
✅ This is a widely recommended best practice. By storing sensitive credentials like the Client ID and Client Secret in environment variables, you reduce the risk of exposing them in your codebase or version control systems (like Git). It also makes it easier to change credentials without updating the source code. This method increases security and flexibility in deployment environments such as cloud services, Docker containers, or CI/CD pipelines.

D. Store credentials in a key management system (KMS) ✅ (Correct Answer)
✅ This is another secure method. Key Management Systems (KMS) like AWS KMS, Azure Key Vault, or HashiCorp Vault are built specifically to store and manage sensitive information like API credentials, encryption keys, and secrets. Using a KMS ensures that your credentials are encrypted at rest and access to them is governed by strict policies, audit logs, and automatic key rotation capabilities.

B. Pass credentials in URL parameters over HTTPS ❌ Incorrect
❌ This is not secure. Even though HTTPS encrypts data in transit, passing credentials via URL parameters can still expose them in browser history, server logs, or monitoring tools. This is considered a vulnerable practice and goes against most secure coding guidelines, especially when dealing with authentication credentials.

C. Set credentials as variables in application source code ❌ Incorrect
❌ Hardcoding credentials in your application source code is considered unsafe. Even if the code is stored in a private repository, it could be leaked accidentally or exposed during debugging or collaboration. If the code is ever compromised or shared, the Client ID and Secret would be easily accessible. This method increases the risk of a data breach or unauthorized access.

A marketing director at Northern Trail Outfitters wants to analyze the Send, Click, and Open Data Views. Which activities should the developer build to generate the data before transferring it to the SFTP?

A. Query Activity > Tracking Extract

B. Data Views Extract > Filter Activity

C. Filter Activity > Data Extension Extract

D. Query Activity > Data Extension Extract

B.   Data Views Extract > Filter Activity

Explanation:

A. Query Activity > Tracking Extract
❌ Incorrect. While a Query Activity is useful for pulling data from Data Views, the option of “Tracking Extract” here is misleading. Tracking Extracts are Automation Studio File Transfer activities, not part of a Query Activity workflow. You cannot run a Tracking Extract directly from a Query. Thus, this option combines two different activities that do not logically follow each other in practice.

B. Data Views Extract > Filter Activity ✅ (Correct Answer)
✅ Correct. The Tracking Extract (part of Data Views Extracts) allows you to export raw tracking data—such as opens, clicks, bounces, and unsubscribes—from Marketing Cloud system Data Views into flat files. This is the correct first step. Afterward, a Filter Activity can be used to refine or sort the exported data, or more commonly, to extract just the subset of rows needed before sending the output to the SFTP for analysis. This combination ensures you get accurate tracking data with optional filtering.

C. Filter Activity > Data Extension Extract
❌ Incorrect. This approach assumes that the tracking data is already in a Data Extension, which it is not by default. Tracking data resides in system Data Views, not in user-created Data Extensions. Also, Data Extension Extracts are used to export Data Extension contents, not tracking metrics. Therefore, this flow does not support the goal of accessing send/click/open data directly.

D. Query Activity > Data Extension Extract
❌ Incorrect. This approach may seem reasonable, but it’s not optimal for this scenario. A Query Activity could be used to select from the Data Views and store the results in a Data Extension, but Data Extension Extracts only export existing Data Extensions. This would require multiple steps and storage overhead. It’s a workaround, but not as direct or efficient as using a Tracking Extract.

A developer wants to retrieve a row of data from a data extension using the SOAP API. Which API Object should be used for this call?

A. Data Extension Field

B. Data Extension

C. Data Extension Object

D. Row

C.   Data Extension Object

Explanation:

A. Data Extension Field
❌ Incorrect. The DataExtensionField object is used when a developer wants to retrieve metadata about the fields (columns) within a data extension. For example, it can be used to understand what fields exist and what their data types or properties are. However, this object does not allow you to retrieve actual data rows from a data extension. Therefore, it’s not the correct choice for retrieving subscriber or customer data records.

B. Data Extension
❌ Incorrect. The DataExtension object provides metadata information about the data extension itself—such as its name, customer key, description, and creation/modification dates. While it’s useful for managing or finding data extensions, it does not provide access to the row-level data within them. A developer trying to fetch data (e.g., customer details or tracking records) will need to use a different object that supports querying actual data.

C. Data Extension Object ✅ (Correct Answer)
✅ Correct. The DataExtensionObject object in the SOAP API is specifically designed to access row-level data from a data extension. You can use it to retrieve, insert, update, or delete records from a data extension. When retrieving a record, you would specify the data extension’s key and filter criteria (e.g., lookup by subscriber key), and the SOAP API will return the matching row(s). This makes it the correct and most efficient option for the task.

D. Row
❌ Incorrect. While "Row" may seem intuitively correct, there is no such SOAP API object named Row. This answer may refer to a conceptual row of data or AMPscript/server-side scripting logic, but not a valid SOAP object. In the context of the Salesforce Marketing Cloud SOAP API, DataExtensionObject is the proper and supported object to use when accessing actual row-level records.

A developer wants to trigger an SMS message to a subscriber using a form published on CloudPages. How should the SMS message be triggered once the subscriber submits the form?

A. Outbound SMS template and Automation Send Method

B. InsertData AMPscript function to add the subscriber to a MobileConnect list

C. CreateSMSConservation AMPscript function

D. requestToken and messageContact REST API objects

D.   requestToken and messageContact REST API objects

Explanation:

A. Outbound SMS template and Automation Send Method
Incorrect. While outbound SMS templates are used to define the content of an SMS message, the Automation Send Method is typically used for scheduled or event-based automations within Automation Studio, not for real-time, user-initiated sends like those from CloudPages. This method cannot directly respond to a CloudPage form submission with an SMS trigger. Therefore, this approach lacks the immediacy and direct integration required for the developer’s use case.

B. InsertData AMPscript function to add the subscriber to a MobileConnect list
Incorrect. The InsertData function can add data to a Data Extension or list, and while it can be useful for recording form submissions, it doesn’t on its own trigger an SMS message. MobileConnect requires a defined message interaction or an API call to send SMS messages. Merely inserting a subscriber into a list does not initiate an SMS send, unless there’s a separate automation that polls that list, which would introduce a delay and reduce responsiveness.

C. CreateSMSConversation AMPscript function
Incorrect. Although this might sound like a logical AMPscript function to use, CreateSMSConversation does not exist as a documented AMPscript function in Marketing Cloud. AMPscript has limitations when interacting with MobileConnect and triggering SMS directly. SMS conversations are handled either through MobileConnect's predefined interactions or through the REST API. Therefore, this answer is invalid both functionally and technically.

D. requestToken and messageContact REST API objects ✅ (Correct Answer)
Correct. To trigger an SMS send in real time after a form submission on CloudPages, a developer should use the REST API. The process involves first acquiring an OAuth requestToken, then calling the messageContact endpoint with the required parameters (such as message key, mobile number, and attribute values). This approach enables the developer to send SMS messages programmatically and immediately in response to user actions, which aligns perfectly with the described scenario.

Salesforce-Marketing-Cloud-Engagement-Developer Exam Questions - Home Previous
Page 5 out of 40 Pages