Home / Salesforce Certified Marketing Cloud Developer / Mock exam
Salesforce Certified Marketing Cloud Developer Exam-style mock test

Salesforce Marketing Cloud Developer Practice Exams|Practice test

Full explanations Exam format Pass line 63%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · AMPscript, Server-Side JavaScript, and Dynamic Content
A B2B SaaS marketer at NimbusCRM builds an email that must pull the single most recent trial-expiry date for the subscriber from the TrialAccounts Data Extension, where one subscriber can have multiple account rows. Which AMPscript function best returns that one value?
・Lookup, because it returns a single field value from the first matching row that satisfies the supplied column and value filter criteria
Incorrect. Lookup returns only the first matching row with no ordering control, so it may return an older expiry rather than the most recent one.
・LookupRows, which returns a full rowset of every matching record that you then loop through
Incorrect. LookupRows returns all matching rows unordered, requiring extra logic and not directly giving the single newest value.
✓LookupOrderedRows, filtering on SubscriberKey and sorting the result set by TrialExpiry in descending order so the newest row is first
Correct. LookupOrderedRows lets you filter by SubscriberKey and sort by TrialExpiry descending, so the first returned row holds the newest expiry date.
・InsertDE, writing the expiry value into the Data Extension before it is read
Incorrect. InsertDE writes data into a Data Extension and does not retrieve any value.
Explanation
When multiple rows match and you need the newest, ordering matters; LookupOrderedRows provides the sort control that Lookup and LookupRows lack.
Example2 · Data Extensions, SQL, and Data Management
A developer at a B2B SaaS company, FlowStack, needs a data extension that automatically retains only subscriber records active in the last 90 days and purges older rows without a scheduled job. Which data extension configuration best fits this requirement?
・A standard data extension with a scheduled SQL query activity that deletes rows older than 90 days during a nightly automation run
Incorrect. A nightly delete query works but requires a scheduled job, which the requirement explicitly rules out as manual overhead.
✓A standard data extension with a data retention policy that deletes individual records 90 days after they are created
Correct. A record-level data retention policy set to delete individual records 90 days after creation purges aging rows automatically with no scheduled activity.
・A filtered data extension pointed at the master set and refreshed each week to exclude older rows
Incorrect. A filtered data extension subsets another DE at refresh time; it does not delete source rows and still needs a scheduled refresh.
・A sendable data extension synced from Sales Cloud contacts using Marketing Cloud Connect
Incorrect. Syncing from Sales Cloud addresses data source, not automatic age-based retention of records.
Explanation
Individual record-level data retention policies delete rows on a rolling age basis without any scheduled automation, matching the no-job requirement.
Example3 · Email, Landing Pages, and CloudPages
A B2B SaaS company sends a trial-expiration email. Each subscriber record in the sendable Data Extension holds an AccountId, and a separate non-sendable Data Extension named AccountPlan stores one row per AccountId with the plan tier. The developer must display the plan tier inside the email for the matching AccountId. Which AMPscript approach retrieves that single value?
・Use LookupRows against AccountPlan and loop through every returned row to concatenate the plan tiers until the matching AccountId is found
Incorrect. LookupRows returns a rowset for iteration and is unnecessary overhead when exactly one matching value is needed from a keyed Data Extension.
✓Use Lookup with AccountPlan, the PlanTier field, AccountId, and the subscriber's AccountId value
Correct. Lookup(DataExtension, ReturnColumn, FilterColumn, FilterValue) returns a single field value, so Lookup with AccountPlan, PlanTier, AccountId, and the subscriber's AccountId returns the one tier.
・Reference AccountPlan directly with the %%PlanTier%% personalization string because the Data Extension is already linked to the send
Incorrect. A non-sendable Data Extension is not automatically available as a personalization string in the send; it must be queried with a lookup function.
・Use InsertDE to push the subscriber's AccountId into AccountPlan and read PlanTier back from the inserted row
Incorrect. InsertDE writes a new row and does not read an existing PlanTier, so it would corrupt the AccountPlan table rather than personalize the email.
Explanation
The Lookup function is the correct tool to pull a single field from a keyed Data Extension, which is more efficient than LookupRows when only one value is required.
Example4 · API, Journey Builder, and Automation
A healthcare services firm sends an appointment-confirmation email the instant a patient books online. The developer wants the booking web app to call Marketing Cloud Engagement directly to deliver a single, personalized message per request. Which REST API approach should the developer use?
✓POST to the messaging interactions resource for a configured triggered send definition, passing the subscriber and attributes in the body
Correct. The triggered send messaging interaction resource delivers a single personalized message in real time for a configured send definition, which fits an instant per-booking confirmation.
・POST a new email asset to the content resource and schedule it for immediate delivery to the patient's list
Incorrect. Posting an asset only stores content; it does not send a per-request real-time message to one patient.
・GET the automation resource and run the confirmation automation on demand for that single patient record
Incorrect. Running an automation on demand is batch-oriented and not designed for single real-time transactional sends.
・PATCH the subscriber's contact record so a running journey re-evaluates the entry event and sends the email
Incorrect. Patching a contact does not reliably trigger an immediate single send and is not the transactional send resource.
Explanation
Real-time, per-request transactional emails such as booking confirmations are delivered through the triggered send messaging interaction resource against a pre-configured triggered send definition.
Example5 · Contact Model, Security, and Deliverability
A healthcare services firm stores patients in a Sendable data extension keyed on PatientID and wants appointment-reminder details (ClinicName, ApptDate) to display per patient without duplicating patient demographics. In Contact Builder, which modeling approach best achieves a normalized Contact Model?
✓Relate a separate Appointments attribute set to the patient attribute group on PatientID so each contact links to its appointment rows
Correct. A related attribute set joined on PatientID keeps demographics in one place and links appointment rows, which is the normalized Contact Model design.
・Flatten all appointment fields into the patient Sendable data extension to avoid any relationship configuration
Incorrect. Flattening every appointment field into the patient record duplicates demographics and breaks normalization as appointments grow.
・Create one sendable data extension per clinic and move patients between them whenever an appointment is scheduled
Incorrect. Splitting patients across per-clinic data extensions fragments the single contact record and complicates subscriber keys.
・Store the appointment data only in Email Studio and skip Contact Builder because reminders are transactional sends
Incorrect. Skipping Contact Builder removes the relationship layer that lets personalization resolve appointment rows per contact.
Explanation
Normalized modeling keeps patient demographics in one attribute group and relates appointment data via an attribute set on the shared PatientID key.
Example6 · AMPscript, Server-Side JavaScript, and Dynamic Content
A developer at a healthcare services firm needs a patient-reminder email to greet each recipient by first name, falling back to a neutral greeting when the FirstName attribute of the sendable data extension is empty. Which AMPscript approach correctly outputs the personalized value?
✓Use AttributeValue("FirstName") to read the field, then wrap the result with an IIF() function that checks Empty() before printing it inline
Correct. AttributeValue() (or direct attribute binding) reads the sendable field, and IIF() with Empty() cleanly substitutes a fallback greeting when FirstName is blank.
・Call Lookup() on the sendable data extension with the SubscriberKey as the filter to pull FirstName, then print the first row
Incorrect. Lookup() queries a separate data extension by filter and is unnecessary and inefficient for a field already available on the sendable context.
・Reference the field with %%FirstName%% substitution strings only, because AMPscript variables cannot read sendable attributes
Incorrect. Substitution strings are legacy; AMPscript can read sendable attributes directly, so this is a false limitation.
・Declare the field with SET @name and call RaiseError() when it is blank so the send halts for that subscriber
Incorrect. RaiseError() would stop the send for that subscriber rather than provide a graceful fallback, which is the opposite of the requirement.
Explanation
Sendable attributes are directly readable in AMPscript; combining AttributeValue() with Empty()/IIF() produces a safe personalized greeting with a fallback.
Example7 · AMPscript, Server-Side JavaScript, and Dynamic Content
At the retailer UrbanThread, a developer must retrieve a single loyalty tier value from the data extension 'LoyaltyMembers' where the EmailAddress column matches the subscriber. Which AMPscript function should the developer use to return that one field value?
・LookupRows, then loop through every returned row to extract the loyalty tier for the subscriber
Incorrect. LookupRows returns a rowset requiring iteration, which is unnecessary when a single scalar field value is needed.
✓Lookup, passing the data extension name, the return column, the lookup column, and its value
Correct. Lookup returns a single field value given the data extension, return column, lookup column, and value, matching this requirement exactly.
・LookupOrderedRows with a sort clause applied to the loyalty tier column before reading it
Incorrect. LookupOrderedRows returns an ordered rowset and is used when sorting multiple rows, not for one scalar value.
・InsertData to write the subscriber loyalty tier into the target data extension row
Incorrect. InsertData writes a new row rather than retrieving an existing field value.
Explanation
Lookup() is the correct function to return a single field value from a data extension based on one matching column.
Example8 · AMPscript, Server-Side JavaScript, and Dynamic Content
UrbanThread wants an email to display a subscriber's three most recent purchases in reverse chronological order from the 'Orders' data extension. Which AMPscript approach correctly returns the rows already sorted?
・Use LookupRows to pull all matching order rows, then rely on the data extension's natural storage order when outputting them
Incorrect. LookupRows does not accept a sort order, so natural storage order is not guaranteed to be chronological.
✓Use LookupOrderedRows with a maximum of 3 rows and an 'OrderDate desc' sort order argument
Correct. LookupOrderedRows accepts a row count limit and a sort clause, returning the three newest orders in descending date order.
・Use Lookup repeatedly inside a counter loop to read each order row one field at a time until three are found
Incorrect. Repeated Lookup calls cannot guarantee ordering and are far less efficient than a single ordered rowset call.
・Use Field on the order rowset after retrieving it so the engine automatically sorts dates descending
Incorrect. Field only extracts a column value from a row and performs no sorting of the rowset.
Explanation
LookupOrderedRows supports a row limit and sort order, making it the correct choice for retrieving ordered results.
Example9 · AMPscript, Server-Side JavaScript, and Dynamic Content
In an UrbanThread newsletter, a developer needs to show a VIP banner only when the subscriber's TierLevel equals 'Platinum'. Which AMPscript construct correctly gates the banner content?
・A FOR loop iterating over TierLevel values from one to the maximum tier count available
Incorrect. A FOR loop repeats a block a fixed number of times and is not used for a single conditional test.
✓An IF statement comparing TierLevel to 'Platinum' and emitting the banner between THEN and ENDIF
Correct. An IF/THEN/ENDIF block comparing TierLevel to 'Platinum' conditionally outputs the banner as required.
・A SET statement that assigns the banner HTML directly into the TierLevel variable
Incorrect. SET assigns a value to a variable and does not perform conditional output.
・A ROWCOUNT check on the subscriber rowset to decide whether the banner is shown
Incorrect. ROWCOUNT returns the number of rows in a rowset and does not evaluate a tier value.
Explanation
IF/THEN/ENDIF is the AMPscript conditional construct used to display content only when a condition is met.
Example10 · AMPscript, Server-Side JavaScript, and Dynamic Content
A developer at Meridian Bank is building a statement email. The subscriber's current account balance lives in a 'AccountBalances' data extension keyed by CustomerID, and each customer has exactly one row. Which AMPscript function should the developer use to pull the Balance value for the sending subscriber's CustomerID?
・LookupRows, because it returns the full rowset the developer then iterates over to reach the single balance value
Incorrect. LookupRows returns a rowset and is meant for multiple rows; using it for a guaranteed single value adds needless Row/Field handling.
✓Lookup, passing the data extension name, the return column, and the CustomerID filter pair
Correct. Lookup returns one column value from the first matching row, which fits a one-row-per-customer lookup by CustomerID.
・LookupOrderedRows, since it sorts the matching rows before the balance can be safely selected
Incorrect. LookupOrderedRows is for retrieving and ordering multiple rows, not for fetching one scalar value.
・Field, which reads the Balance directly from the data extension without any lookup call
Incorrect. Field reads from a Row object already retrieved; it cannot query a data extension on its own.
Explanation
Lookup is the correct function to return a single column value from the first matching row of a data extension, which is exactly the one-row-per-customer design here.
Example11 · AMPscript, Server-Side JavaScript, and Dynamic Content
At Harbor Credit Union, a developer must list all open loans for the subscriber inside an email. A 'Loans' data extension holds many rows per CustomerID. Which pattern correctly retrieves and loops through every matching loan?
・Call Lookup once and repeat it in a For loop until it stops returning a loan value for the customer
Incorrect. Lookup only ever returns the first match, so repeating it cannot enumerate multiple loan rows.
✓Use LookupRows to get the rowset, read RowCount, then For loop with Row and Field on each row
Correct. LookupRows returns the rowset; RowCount drives a For loop, and Row plus Field extract each loan's values.
・Use BuildRowsetFromString on the CustomerID and pass each parsed token into a nested Field call
Incorrect. BuildRowsetFromString parses a delimited string into a rowset; it does not query a data extension by key.
・Query the rows with LookupRows and output them, since the rowset renders every loan automatically
Incorrect. A rowset does not render on its own; the developer must loop and output each row explicitly.
Explanation
Multiple rows require LookupRows to obtain the rowset, then a For loop using RowCount, Row, and Field to process each matching loan.
Example12 · AMPscript, Server-Side JavaScript, and Dynamic Content
A manufacturing distributor sends an order-confirmation email. The developer needs to pull a single AccountRep name from a Data Extension named 'Reps' where the subscriber's RegionCode matches the Region column. Which AMPscript function should the developer use to return one value from one matching row?
・LookupOrderedRows("Reps", 1, "Region asc", "Region", @region) to return the first matching row ordered ascending
Incorrect. LookupOrderedRows returns a rowset requiring Row/Field extraction, which is unnecessary overhead when a single scalar value is needed.
✓Lookup("Reps", "AccountRep", "Region", @region)
Correct. Lookup() returns a single field value from the first matching row, which is exactly what is needed for one AccountRep name.
・LookupRows("Reps", "Region", @region) to pull the entire matching row set into a rowset variable
Incorrect. LookupRows returns a full rowset of matching rows, not a single scalar value, and still needs Field() extraction.
・BuildRowsetFromString("Reps", @region) to parse the delimited Region value into rows
Incorrect. BuildRowsetFromString parses a delimited string into a rowset and does not query a Data Extension at all.
Explanation
Lookup() is the AMPscript function that returns a single column value from the first matching row of a Data Extension, ideal for retrieving one AccountRep.
Example13 · AMPscript, Server-Side JavaScript, and Dynamic Content
In a promotional email for industrial fasteners, the developer must display a 'Bulk Discount' block only when the subscriber's attribute @annualSpend is greater than 50000; otherwise a standard block should appear. Which AMPscript structure correctly handles both outcomes?
・Use a SET statement that assigns the discount block to a variable whenever @annualSpend exceeds the numeric threshold value of fifty thousand
Incorrect. A bare SET assignment has no branching and cannot render an alternate block when the condition is false.
✓IF @annualSpend > 50000 THEN ... ELSE ... ENDIF
Correct. The IF/THEN/ELSE/ENDIF block is the standard AMPscript conditional that renders one block or the other based on the comparison.
・IIF(@annualSpend > 50000, "Bulk", "Standard") nested inside a FOR loop
Incorrect. IIF is not a native AMPscript function, and wrapping it in a FOR loop adds unnecessary iteration logic.
・CASE @annualSpend WHEN > 50000 THEN block ENDCASE
Incorrect. AMPscript has no CASE/WHEN/ENDCASE statement; conditional branching is done with IF/ELSEIF/ELSE/ENDIF.
Explanation
AMPscript uses IF...THEN...ELSE...ENDIF for conditional rendering; there is no CASE statement and IIF is not a native function.
Example14 · AMPscript, Server-Side JavaScript, and Dynamic Content
A telecom operator sends a monthly usage email where each subscriber's current data plan name must be pulled from a 'DataPlans' Data Extension keyed on the subscriber's PlanId. The developer needs to retrieve a single PlanName value for the one matching row. Which AMPscript function should the developer use?
・Use the LookupRows function and then iterate over the returned rowset with a loop to display the first PlanName
Incorrect. LookupRows returns a rowset and requires extra iteration, which is unnecessary when only one scalar value is needed.
✓Use the Lookup function, passing the Data Extension, the PlanName field, and the PlanId lookup criteria
Correct. Lookup returns a single field value from the first matching row, which is exactly what is needed to fetch one PlanName by PlanId.
・Use the LookupOrderedRows function to sort the returned rows before extracting the PlanName
Incorrect. LookupOrderedRows returns an ordered rowset and is meant for retrieving and sorting multiple rows, not a single value.
・Use the InsertDE function to write the PlanId and then read back the resolved PlanName
Incorrect. InsertDE adds a row to a Data Extension and does not retrieve existing field values.
Explanation
Lookup is the correct function when you need one scalar value from the first matching row of a Data Extension; LookupRows and LookupOrderedRows return rowsets intended for multiple records.
Example15 · AMPscript, Server-Side JavaScript, and Dynamic Content
In a telecom retention email, the developer must show a loyalty offer block only when the subscriber's TenureMonths attribute is greater than 24; otherwise a standard upgrade block should appear. Which AMPscript construct correctly implements this branching?
・A SET statement that concatenates both the loyalty block and the upgrade block together into a single output variable
Incorrect. SET only assigns a value and concatenation would output both blocks rather than choosing one conditionally.
✓An IF/THEN/ELSE/ENDIF block that evaluates TenureMonths and outputs the matching block
Correct. IF/THEN/ELSE/ENDIF evaluates the TenureMonths condition and renders only the appropriate block.
・A FOR loop that counts up to TenureMonths and prints the loyalty block on each iteration
Incorrect. A FOR loop iterates a fixed number of times and would repeat the block, not branch between two options.
・An AttributeValue call that automatically selects the block based on TenureMonths
Incorrect. AttributeValue only reads a subscriber attribute value and performs no conditional branching.
Explanation
Conditional content display in AMPscript is handled by IF/THEN/ELSE/ENDIF, which evaluates a condition and renders the matching branch.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)