Segments
How to tag contacts and accounts with segments, and keep Salesforce Campaigns in step with them.
Overview
A segment is a label you put on a contact or an account: Newsletter, Major Donor, Volunteer, 2026 Gala. Segments live in a multi-select picklist field, and the Segment Picker puts that field on a record page as a row of clickable pills.
The second half is Campaign sync. Every segment corresponds to a Salesforce Campaign of the same name, and sync keeps the two in agreement: tag someone Volunteer and they become a member of the Volunteer campaign. Fundraisers get to manage campaign membership by clicking labels, without opening a campaign at all.
Segments and campaigns are matched by name, and by nothing else. The segment Volunteer is tied to the campaign named exactly Volunteer. Rename either one and the link is broken, silently. That is worth knowing before you rename anything.
Adding it to a page
The package does not ship a segment field of its own. Point the component at a multi-select picklist your org already has, which is what lets the same component drive different fields on different pages.
In the Lightning App Builder, drag Flourish Core: Segment Picker onto a record page.
| Setting | What it does |
|---|---|
| Multiselect Field API Name | Required. The multi-select picklist holding the segments, such as My_Segments__c. A field on the parent record works too, written as Account.My_Segments__c. One level of relationship only. |
| Card Title | The heading on the card. Defaults to Segments. |
| Enable Campaign sync | Shows the Sync to Campaigns button. Off by default. |
| Account Contact Fields (Campaign sync) | Only matters for accounts. See Tagging an account. |
Sync itself only ever looks at Contact and Account, and only at whichever of them actually carries the field. You can put the picker on another object's record page to edit a field there, but nothing will sync.
Tagging a record
The card shows a pill for every available segment, with the ones already on the record highlighted.
- Click pills to select and deselect them. Nothing is saved yet.
- Click Save. A Saved confirmation appears.
Leaving the page without saving loses the selection, so save before you navigate away.
Adding a segment nobody has used yet
Type the name in Add a new option and click Add.
This creates the value on the field itself, for everyone, so it is a change to your org rather than to this record. It is selected on the record you are on straight away, and a confirmation names it. Typing one that already exists warns you and does nothing.
It is still just a Save away from being nothing. Adding an option makes it available; it does not put it on the record. Click Save afterwards.
Two things can stop Add working:
- It needs the org's connection credentials. Creating a picklist value is a change to your org's setup, so it uses the Client Id and Client Secret from the connection wizard in Setup, along with the
OrgDomainremote site. Without them, Add fails with a message naming what is missing. Selecting and saving existing segments is unaffected and keeps working. - A field using a global value set cannot be edited this way. Those values are managed in Setup, and the message says so. Everything else about the picker still works.
If the same field name exists on both Contact and Account, a new value is added to both, so the two stay in step.
Keeping Campaigns in step
With Enable Campaign sync on, the card header carries a Sync to Campaigns button.
It reconciles the whole org, not the record you are on. The button sits on a record because that is where someone is when they want it, but a run goes over every contact and account carrying the field, and every campaign that matches. Expect it to fix things you were not looking at.
It saves your on-screen pills first, so what you can see is what syncs.
A run does this:
- Finds every contact and account with a segment on it.
- Works out the segments in play: every value defined on the field, every value actually on a record, and every campaign already opted into sync.
- Matches each segment to the campaign with that name.
- Creates any campaign that is missing, but only where the segment has at least one real member. Empty segments do not produce empty campaigns.
- Adds and removes campaign members, or adds and removes segments on records, according to each campaign's direction. See Which side wins.
A new campaign is created Active and set to Record Controls.
When it finishes, a summary reports five numbers: campaigns created, members added, members removed, contacts updated, accounts updated. Anything it wants to tell you about arrives as a second Sync notes message that stays on screen until you dismiss it.
A row that fails does not stop the run. If a handful of members or records cannot be written, the rest still go through and the failures come back in the notes. A run either finishes or tells you what it could not do.
Which side wins
When a record and a campaign disagree, something has to give. Each campaign decides for itself, through a Segment Sync Direction field on the campaign.
| Direction | What is the source of truth |
|---|---|
| Record Controls | The segments on the record. Members are added and removed to match. |
| Campaign Controls | The campaign's member list. Segments are added to and removed from records to match. |
| Blank | Treated as Record Controls. |
Record Controls is the usual answer, and what auto-created campaigns get. Someone tagged Volunteer is added to the Volunteer campaign, and someone who loses the tag is removed from it.
Campaign Controls is for a campaign managed directly, by a list import or by the campaign tools. Add someone as a member and they gain the segment; remove them and they lose it.
Setting a direction is also what opts a campaign into sync, which matters for Campaign Controls: such a campaign stays in play even when nobody carries its segment yet, which is exactly how it pushes its label onto its members the first time.
Tagging an account
Salesforce accounts cannot be campaign members. Only contacts and leads can. So when an account carries a segment, what joins the campaign is the account's contacts.
Which contacts is your decision. Account Contact Fields (Campaign sync) takes a comma-separated list of contact lookup fields on Account, a primary contact lookup being the usual one. Whoever those fields point at becomes the member on the account's behalf.
Leave it blank, or leave those fields empty on the account, and the account contributes no members. It is skipped rather than reported, so an account tagged with a segment and no designated contact quietly does nothing.
Under Campaign Controls it works the other way: an account gains the segment when any of its designated contacts is a member of the campaign.
Running it nightly
Clicking a button covers the moment someone remembers. A scheduled run covers everything else, including the records nobody opened.
The package ships a Flow called Segment Nightly Sync, and it is a template rather than something that runs as installed. It carries the placeholder field name REPLACE_WITH_YOUR_MULTISELECT_FIELD__c, so it does nothing useful until you point it at a real field.
- Open it in Setup > Flows and Save As a copy of your own.
- Set Segment Field API Name to your segment field, and Account Contact Fields if you sync accounts.
- Set the schedule. The template is daily at 07:00 UTC.
- Activate your copy.
It runs the same whole-org reconciliation the button does.
A blank field name is a no-op rather than an error, which is why an unconfigured copy looks like it is working and changes nothing.
Things worth knowing
- Names are the whole mechanism. Rename a segment value or a campaign and they stop matching. Nothing warns you; the two simply drift apart on the next run.
- Keep campaign names unique. If two campaigns share a name, the oldest is used and the run says so in its notes.
- Sync is never about one record. Every run reconciles everything for that field.
- Deselecting a pill removes someone from a campaign under Record Controls. That is the point, and it is easy to do by accident while tidying up a record.
- Adding an option changes your org. Everyone sees a new segment the moment someone types one, and removing it again is a Setup job.