> ## Documentation Index
> Fetch the complete documentation index at: https://docs.benefitflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Linking Employers to Their Primary Broker Office

> Connect each employer to its primary broker office in your CRM using BenefitFlow IDs.

BenefitFlow links brokers, their office locations, and contacts in your CRM
automatically. Employers are different: they sync as standalone accounts with no
built-in tie to the broker that serves them. This guide shows you how to add that
link yourself, so every employer points to its primary broker office.

<Info>
  The broker hierarchy (broker → office → contact) is created for you on every sync.
  You don't need to build it. See [CRM Integration: Association
  Architecture](/knowledge-base/crm-association-architecture) for how that works.
  This guide covers the one association BenefitFlow does not create automatically:
  employer to primary broker office.
</Info>

## Why link employers to broker offices

Once the link is in place, you can:

* See every employer tied to a given broker office from that office's record
* Spot whitespace: offices with employers you haven't worked yet
* Report pipeline and closed revenue by broker relationship (see [Tracking ROI from
  BenefitFlow](/knowledge-base/crm-roi-tracking))

## How the link works

Every record BenefitFlow syncs carries an ID:

| Record        | ID field in the mapping table                | What it identifies                             |
| ------------- | -------------------------------------------- | ---------------------------------------------- |
| Employer      | **Primary Broker Office ID (Employer Only)** | The employer's primary broker's closest office |
| Broker office | **Broker Office ID**                         | That office's own unique ID                    |

The two share the same ID space, so the link is a match: find the broker office
whose **Broker Office ID** equals an employer's **Primary Broker Office ID**, then
associate the two records. You'll map both IDs into your CRM, then build a short
automation that makes the match.

<Note>
  "Primary broker" is the broker that reports the largest share of commissions for an
  employer on the Form 5500. The office BenefitFlow links to is that broker's closest
  office to the employer. See [What is the Primary
  Broker?](/knowledge-base/primary-broker) for the full definition.
</Note>

## Before you start

* Your brokers, broker offices, and employers are synced to your CRM
* You have admin access in both BenefitFlow and your CRM
* Test on a small batch (5 to 10 records) before running across your full database

<Tabs>
  <Tab title="HubSpot">
    ### Step 1 — Create two company properties

    Go to **Settings → Properties → Company Properties** and create a group called
    **BenefitFlow Fields**, then add two single-line text properties to it:

    | Property                     | Holds                                  |
    | ---------------------------- | -------------------------------------- |
    | BenefitFlow Broker Office ID | A broker office's own ID               |
    | Primary Broker Office ID     | An employer's primary broker office ID |

    ### Step 2 — Map the IDs in BenefitFlow

    In **Integration Settings**, open your HubSpot field mapping:

    * On the **Employer** (Parent Account) mapping, map **Primary Broker Office ID
      (Employer Only)** → `Primary Broker Office ID`
    * On the **Broker Office** (Child Account) mapping, map **Broker Office ID** →
      `BenefitFlow Broker Office ID`

    Turn on **Allow Overwrite** for both so they stay current on re-sync. Sync 5 to 10
    records and confirm both fields populate before going further.

    ### Step 3 — Create association labels

    Go to **Settings → Objects → Companies → Associations** and create a
    company-to-company association with two labels: **Employer** and **Primary Broker
    Office**.

    ### Step 4 — Build the association workflow

    Create a company-based workflow:

    1. Enrollment trigger: **Primary Broker Office ID is known**
    2. Add the **Create associations** action and choose **Matching property values**.
       Match the enrolled employer's **Primary Broker Office ID** to a company's
       **BenefitFlow Broker Office ID**
    3. Apply the **Employer** and **Primary Broker Office** labels to each side
    4. Test on one employer, confirm the association shows on both records, then enroll
       existing companies

    <Tip>
      Matching property values is exact and case-sensitive, and works only on single-line
      text properties (which is why both ID fields above are single-line text). Since
      BenefitFlow writes both IDs, the values line up automatically.
    </Tip>

    <Check>
      Each employer now links to its primary broker office. Open any broker office record
      to see its full list of employer clients.
    </Check>
  </Tab>

  <Tab title="Salesforce">
    ### Step 1 — Create two Account fields

    In **Setup → Object Manager → Account → Fields & Relationships**, create two text
    fields (length 50):

    | API name                      | Label                        | Holds                                  |
    | ----------------------------- | ---------------------------- | -------------------------------------- |
    | `BF_Broker_Office_ID__c`      | BenefitFlow Broker Office ID | A broker office's own ID               |
    | `Primary_Broker_Office_ID__c` | Primary Broker Office ID     | An employer's primary broker office ID |

    ### Step 2 — Map the IDs in BenefitFlow

    In your Salesforce field mapping:

    * On the **Employer** (Parent Account) mapping, map **Primary Broker Office ID
      (Employer Only)** → `Primary_Broker_Office_ID__c`
    * On the **Broker Office** (Child Account) mapping, map **Broker Office ID** →
      `BF_Broker_Office_ID__c`

    Enable overwrite on both. Test on 5 to 10 records before proceeding.

    ### Step 3 — Link the records with a Flow

    Build a record-triggered Flow on Account that runs when `Primary_Broker_Office_ID__c`
    is set. Have it find the Account where `BF_Broker_Office_ID__c` equals that value, then
    either:

    * **Set Parent Account** to the broker office (uses the native Account Hierarchy), or
    * **Set a custom lookup field** to the broker office (use this if Parent Account is
      already in use for another relationship)

    ### Step 4 — Validate and backfill

    Run the Flow on a few records and confirm the right office is linked. Then re-sync
    your employer lists to backfill IDs, and activate the Flow across existing records.
  </Tab>

  <Tab title="Dynamics 365">
    ### Step 1 — Add two Account columns

    In **Power Apps → Dataverse → Tables → Account**, add two text columns (max length 100):

    | Column                     | Display name                 | Holds                                  |
    | -------------------------- | ---------------------------- | -------------------------------------- |
    | `bf_brokerofficeid`        | BenefitFlow Broker Office ID | A broker office's own ID               |
    | `bf_primarybrokerofficeid` | Primary Broker Office ID     | An employer's primary broker office ID |

    ### Step 2 — Map the IDs in BenefitFlow

    In your Dynamics field mapping:

    * On the **Employer** (Parent Account) mapping, map **Primary Broker Office ID
      (Employer Only)** → `bf_primarybrokerofficeid`
    * On the **Broker Office** (Child Account) mapping, map **Broker Office ID** →
      `bf_brokerofficeid`

    Enable overwrite on both. Test on 5 to 10 records first.

    ### Step 3 — Link the records with Power Automate

    Build an automated cloud flow that triggers when an Account row is added or modified
    and `bf_primarybrokerofficeid` is set. Use **List rows** to find the Account where
    `bf_brokerofficeid` equals that value, then set the employer's **Parent Account** to
    that broker office (or relate them with a custom Connection Role).

    ### Step 4 — Backfill

    Test on one record, then trigger the flow across existing employers with a Dataverse
    bulk update.
  </Tab>
</Tabs>

<Warning>
  The CRM-side automation (HubSpot workflow, Salesforce Flow, Power Automate) runs in
  your CRM, not in BenefitFlow. BenefitFlow pushes the IDs; your CRM makes the match.
  Build and test the automation in a sandbox before running it on production data. See
  [Can I create CRM workflows from within
  BenefitFlow?](/knowledge-base/crm-integration-faq) for what the integration does and
  doesn't handle.
</Warning>

## Keeping the link current

BenefitFlow IDs can change over time as company data is reconciled, for example when
records are merged or a primary broker is recalculated. When that happens, the IDs in
your CRM only update on the next sync, so:

* Keep **Allow Overwrite** on for both ID fields so re-syncs refresh them
* Re-run your association automation after a sync so links rebuild against the current
  IDs. A scheduled or re-enrollment run keeps associations from going stale
* A link built on an ID that later changes can point to the wrong office until the
  automation runs again, so re-run it before you rely on these associations for
  reporting

## Related resources

<CardGroup>
  <Card title="CRM Integration: Association Architecture" icon="diagram-project" href="/knowledge-base/crm-association-architecture" horizontal={true} />

  <Card title="Tracking ROI from BenefitFlow" icon="chart-line" href="/knowledge-base/crm-roi-tracking" horizontal={true} />

  <Card title="What is the Primary Broker?" icon="circle-question" href="/knowledge-base/primary-broker" horizontal={true} />
</CardGroup>
