From BPM to CSV: A Practical Subcase of Relating Records in Sugar

Author: Yuri Gee

Date: 26 Aug 2025

5 minute read time

In this follow-up article, I’ll demonstrate how the previously introduced BPM extension for adding related records can be leveraged to expand the types of relationships imported by the standard CSV import wizard. Specifically, we’ll explore how to related multiple Contacts with a Case record—an enhancement beyond the default import wizard functionality, which currently only allows linking cases to a related Account.

Implementation Details

We’ll start by adding a test field called relate__condition_c (Relate Condition) to the Contacts module, and a service field named contact_id_c (Import Contact Id) to the Cases module.

Next, we’ll build a simple BPM process within the Cases module that activates on every update. This process will:

  • check if the contact_id_c service field contains a value
  • use that value to locate and relate the corresponding Contact record (by record id in Relate Condition extension)
  • clear the service field once the relationship has been established

 BPM extending CSV import Wizard for Cases

This setup enables dynamic linking of Contacts to Cases during import, extending the default behavior of the system.

Finally, by using an import file similar to the one illustrated in the image, we’ll link two sample Contact records to an existing Case. This will be done through the CSV wizard in Update mode, allowing us to enrich the Case with multiple related Contacts.

 Sample import file for Cases - Contacts

Additional Notes

This example illustrates how some previously introduced building blocks—designed to solve the problem in a more general way—can be adapted to a range of specific scenarios. In this case, we’ve applied them to the CSV import wizard to achieve the desired result.

While rapid, consecutive updates may require more robust synchronization mechanisms, this method is generally adequate for simple import tasks that don’t demand the enhanced functionality offered by the REST API.