📋 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
-
In your repeatable question group, add a Text question.
-
Reference the unique value you want to exclude on the 2nd attempt, for example: QG1.DealHub_Subscription__cId_copy
-
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
-
Outside the repeatable group, create a Text answer.
-
Reference the Id copy field you created in Step 1
-
Add parentheses ( )
-
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)
-
Add the Reference question for Step 1
('000000000000000000'%QG1.DealHub_Subscription__cId_copy%)

3️⃣ Configure the Query
-
Go to Version Settings - > Manage External Objects and edit your query
-
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.

