2.7.0 | 03/15/2025
Why Does Merge Data Show Extra Items? | Example Scenario: AccountPartners Related List | How to Resolve or Filter Extra Items | Testing and Verification | Explore More Articles
Understanding Extra Items in Merge Data for Related Lists
Why Does Merge Data Show Extra Items? ↵
When working with Mambo Merge, you may notice that Merge Data or Template Builder displays more items than what is visible on the Salesforce Record Page. Salesforce structures certain objects in a way that may cause duplicate entries in Merge Data.
Junction Objects - Bidirectional Relationships
Salesforce uses “To” and “From” fields to record both sides of a relationship. In objects with these relationships:
- The To field points to the Related List - Record.
- The From field points to the lookup of the Related List - Record on the Primary Salesforce Object.
This bidirectional setup results in each Related List - Record being listed twice in Merge Data—once for each direction.
Objects like AccountPartners act as junction objects, linking two records. Since Salesforce treats each reference separately, both “To” and “From” references appear in Merge Data, effectively doubling the entries.
Example Scenario: AccountPartners Related List ↵
Example:
- Salesforce Record Page: Displays two unique Account Partners for an Opportunity.
- Merge Data Output: Displays four entries due to bidirectional references in the AccountPartners related list.
This behavior reflects Salesforce’s object structure rather than a data error.
How to Resolve or Filter Extra Items in Merge Data ↵
If extra items appear in Merge Data, use the following methods to refine the output:
Output Related List Records Individually
- Using numerical values, you can output records individually
-Example:
{{AccountPartners[0].Name}}, {{AccountPartners[1].Name}}
Refine Your Template Query
- Use conditional logic between your
forEach
merge fields in your template to exclude duplicate entries. - Example: Use
{{if:true FieldName="Value"}}DISPLAY OUTPUT HERE{{/if:true}}
to include only one set of the Related List - records.
Note: Check your Template Builder for more variation on conditional logic.
Modify Relationship Settings in Mambo Merge
- Adjust your Relationship Query in the Routine Wizard to filter out duplicates and include only unique records.
Testing and Verification ↵
-
Run a Test Merge
- Generate a document using the template to verify whether duplicates appear.
-
Adjust as Needed
- If duplicates persist, revisit your template, query settings, or conditional logic to refine the output.
Ensure Your Data Matches Your Needs ↵
Understanding how Salesforce relationships function helps you refine Merge Data and ensure document accuracy. By adjusting your Relationship Query, Related Lists, and Merge Logic, you can eliminate duplicate entries and generate clean, structured output.
For more guidance, explore these articles: