Flagsmith / Flagsmith/flagsmith
Bulk upload a list of Identities to include in a segment
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 567
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 121
Description
# Overview
We regularly receive requests like:
> Is there a way to bulk upload a list of rules (e.g. user Ids) to include in a segment?
The current best solution to this is to either manually or via the API set a Trait against the list of users, and then make a simple segment rule to match that Trait. This is a relatively painful process in the dashboard, and if you don't have coding skills can be an impediment. It's also not obvious or discoverable from the dashboard - you have to work it out by yourself.
# Possible Solutions
## Solution 1 - Add an `IdentitySegment` table to allow Identities to be joined to Segments
Add a new table that joins Identities with Segments. Modify the Rules Engine to automatically include these Identities into the Segment.
### Pros
- Keeps a record of all Identity overrides so they can be easily viewed in the dashboard
- More logically obvious to end users who want to see their data in one place.
### Cons
- Modifies the DB schema
- Requires Flagsmith Engine changes across all SDKs
## Solution 2 - Add a new UI area that allows for bulk uploading of Traits to Identities.
This is basically a shortcut to help with the current solution. Provide a UI area that allows for a TextArea that accepts a list of Identity IDs, 1 per line. Then allow the user to define trait keys and values to apply to all of these identities (creating the identities and traits if they do not exist). The user can then define a Segment that matches these Identities based on those traits
### Pros
- Doesnt modify the schema
- Doesnt require Flagsmith Engine changes
- Fits with current object model
- Reinforces current object model
### Cons
- In Edge, these Identities get "lost" - its not possible currently to search for Identities based on Traits. So it's impossible to keep track of these Identities within the UI.
Contributor guide
Assessment
This issue has not been assessed yet.