Creating segments
Learn more about segments in Reflag
What segments are
Segments are reusable audiences built from companies, users, or both together.
You build them from filters such as company lists, user lists, company attributes, user attributes, flag access, and flag metrics.
Use segments when you want to save an audience once and reuse it across multiple flags in access rules.
Create a segment
Open Segments in the sidebar.
Click Add filter +.
Add the conditions for the companies, users, or combined audience you want to include.
Save the segment.
Choose segment conditions
Each segment uses one or more conditions. Add as many conditions as you need.
Condition types
You can build a segment from these condition types:
Company attribute— match company data such asplan IS 'pro'User attribute— match user data such asrole CONTAINS 'admin'Company list— search by company name or paste company IDsUser list— search by user name or paste user IDsFlag accessIs enabledIs not enabled
Flag metricTrack countExposure countFirst trackLast track
SegmentIn segmentNot in segment

How conditions work
All conditions in a segment must match.
That means segment conditions work like AND.
You can combine company conditions and user conditions in the same segment.
Common examples
Pro customers —
Company attribute: plan IS 'pro'Admin users at beta companies —
User attribute: role CONTAINS 'admin'andSegment: In segment 'Beta customers'Companies with access to a flag —
Flag access: [Flag name] is enabled
Available operators
Operators depend on the condition type:
Any
IsIs notHas any valueHas no value
Text
ContainsDoes not contain
List
Is any ofIs not any of
Number
Less thanGreater than
Boolean
Is trueIs false
Date
Less than X days agoMore than X days agoBefore date XAfter date X
Flag access
Is enabledIs not enabled
Segment
In segmentNot in segment
These attribute operators are also available when you create flag access rules.
Array attributes
Attributes can hold arrays such as roles: ["admin", "editor"]. Array operators compare whole items and are case-sensitive: admin does not match Admin or part of a value such as adm.
Is
It has exactly one item, equal to the selected value.
Is not
It is empty, has more than one item, or its only item differs from the selected value.
Contains
It includes the selected value.
Does not contain
It does not include the selected value.
Is any of
It includes at least one selected value.
Is not any of
It includes none of the selected values.
Has any value
It has at least one item.
Has no value
It is empty.
For example, roles: ["admin", "editor"] matches Contains admin and Is any of [admin, owner], but it does not match Is admin.
Number, date, and boolean operators do not support arrays, and arrays cannot be used for percentage rollouts. If an access rule applies an unsupported operator to an array, that rule does not match.
Save and reuse the segment
After you save a segment, you can reuse it in flag access rules and rollout workflows.
You can create as many segments as you need.

Last updated
Was this helpful?