Skip to main content
Question

How to Ensure Each Record Can Be Selected Only Once in a Repeatable Table with an External Query (Salesforce)

  • December 28, 2025
  • 0 replies
  • 48 views

Forum|alt.badge.img+2

 

📋 Use Case

You have a repeatable product selection question group with a query, and need to prevent users from selecting the same record multiple times.

 

Pre-Requisites

Before you begin, confirm the following:

  • Familiarity with SOQL External Query syntax.

  • Knowledge of repeatable question groups.

  • Unique value of the records that can be used as a filter

🧭 Step-by-Step Instructions

1️⃣ Create a copy of the unique value in the Repeatable Group

  1. In your repeatable question group, add a Text question.

  2. Reference the unique value you want to exclude on the 2nd attempt, for example: QG1.DealHub_Subscription__cId_copy

  3. Include a comma and a single quote (' ) at the beginning (after the comma) and end.

    ,'%QG1.DealHub_Subscription__cId%'

2️⃣ Aggregate Ids Outside the Repeatable Group

  1. Outside the repeatable group, create a Text answer.

  2. Reference the Id copy field you created in Step 1

  3. Add parentheses ( )

  4. Add a dummy value (for null cases), to be first, make sure it is quoted ' '. (if it is a SFDC Record Id, must have 18 characters)

  5. Add the Reference question for Step 1

    ('000000000000000000'%QG1.DealHub_Subscription__cId_copy%)

3️⃣ Configure the Query

  1. Go to Version Settings - > Manage External Objects and edit your query

  2. Add to the WHERE Clause (if exits, if not add one) the name of the field holding the Unique value on the record in SF,  add the operator NOT IN, and the use the PLAYBOOK(questiongroup.questions) parameter to compare to the question outside of the repeatable

    Id NOT IN PLAYBOOK(QG3.outside)

🏁 Result

When users select records, already-selected records are dynamically excluded from the available options. This prevents duplicates and keeps your record selection process clean and efficient.