|
| 1 | +--- |
| 2 | +title: Basic Flag Management |
| 3 | +sidebar_label: Basic Flag Management |
| 4 | +sidebar_position: 1 |
| 5 | +--- |
| 6 | + |
| 7 | +Feature flags in Flagsmith are used to categorise and monitor user actions or events, such as detecting spam or abuse. This guide covers how to create, edit, clone, and delete flags in your project. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Creating a Feature Flag |
| 12 | + |
| 13 | +To create a new feature flag: |
| 14 | + |
| 15 | +1. Go to the **Features** section in your dashboard. |
| 16 | +2. Click **Create Feature**. |
| 17 | +3. Enter a descriptive name for your flag (e.g., `new_ui_enabled`). |
| 18 | +4. Fill in the available fields according to the specifications of your feature. Note that these values are applied to all your [environments]. You can edit each environment individually later. |
| 19 | + - **Enabled by default**: determines the initial state of the flag for all environments. This can be edited for each environment later. |
| 20 | + - **Value** (optional): additionally to their boolean value, you can choose a format and a value for your flag. |
| 21 | + - **Tags** (optional): organise your flags by tags or add `protected` to prevent them from accidentally being deleted. |
| 22 | + - **Description** (optional): add a feature flag description. |
| 23 | + - **Server-side only**: enabling this prevents your flag from being accessed by client-side SDKs. |
| 24 | +5. Click **Create Feature**. |
| 25 | + |
| 26 | +:::tip |
| 27 | + |
| 28 | +By clicking the **Create A/B/n Test** button, you can define values for A/B testing. To learn more about this operation, refer to the [A/B Testing guide](../advanced-use/ab-testing). |
| 29 | + |
| 30 | +::: |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Editing a Feature Flag |
| 35 | + |
| 36 | +You create feature flags once per project, but you edit them within each environment. To edit an existing feature flag: |
| 37 | + |
| 38 | +1. While on the **Environments** tab on the dashboard, use the dropdown to select the environment where you want to apply the changes. |
| 39 | +2. Locate the feature flag you want to edit and click on it. You can use the search bar to find the feature flag by its name. |
| 40 | + |
| 41 | +:::tip |
| 42 | + |
| 43 | +If you just want to toggle the feature flag *on* or *off*, use the switch under the **View** column in the list view. |
| 44 | + |
| 45 | +::: |
| 46 | + |
| 47 | +3. On the **Value** tab, you can set the feature flag to be on or off, as well as edit a value for it. Click **Update Feature Value** to save your changes. |
| 48 | +4. Optionally, create segment-specific feature flags and define **segment overrides**. Refer to the documentation to learn more about [segments](../basic-features/segments.md). Save any changes by clicking the **Update Segment Overrides** button. |
| 49 | +5. On the **Settings** tab, you can: |
| 50 | + - Add tags to your feature flag. |
| 51 | + - Assign it to specific *users* and *groups*. |
| 52 | + - Update the feature flag's description. |
| 53 | + - Mark the feature flag as **Server-side only** to prevent it from being accessed by client-side SDKs. |
| 54 | + - Set the **Archived** status to filter the feature flag as no longer relevant. Note that the feature flag will still be returned by the endpoint as before. |
| 55 | + Click **Update Settings** to save your changes. |
| 56 | + |
| 57 | +:::tip |
| 58 | + |
| 59 | +Changes made in the **Settings** tab affect all environments. Changes made in other tabs while editing a feature flag are valid only for the selected environment. |
| 60 | + |
| 61 | +::: |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Deleting a Feature Flag |
| 66 | + |
| 67 | +To delete a feature flag: |
| 68 | + |
| 69 | +1. In the **Features** section, locate the feature flag you want to remove and click the **three dots** icon on the right. |
| 70 | +2. Select the **Remove feature** option. |
| 71 | +3. Type in the name of the feature flag to confirm the deletion. |
| 72 | + |
| 73 | +:::caution |
| 74 | + |
| 75 | +Deleting a feature flag is permanent and cannot be undone. Make sure your applications do not contain any reference to this feature flag before confirming deleting it. |
| 76 | + |
| 77 | +::: |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## Troubleshooting |
| 82 | + |
| 83 | +### Feature Flags Not Updating |
| 84 | + |
| 85 | +- Make sure you have saved your changes in each tab of the edit feature flag panel. |
| 86 | +- Check that you are in the correct project and environment. |
| 87 | + |
| 88 | +### Permission Issues |
| 89 | + |
| 90 | +- You may need additional permissions to create, edit, clone, or delete feature flags. If you see permission errors or options are disabled, contact your Flagsmith administrator to review your access rights. For more information, see the [Permissions and Roles](../system-administration/rbac.md) page. |
0 commit comments