FLOW_CheckFeatureFlag
Class · Group: Feature Flags
Learn it: Fast Start - Feature Flags and Feature Flags guide
apex
global inherited sharing class FLOW_CheckFeatureFlagThis class is used in Flows to check whether a specific feature flag is enabled. It provides a method that can be invoked from a flow to determine if a feature is active for the current user based on the UTIL_FeatureFlag utility.
Example
apex
List<Boolean> results = FLOW_CheckFeatureFlag.isEnabled(new List<String> {'NewDashboard'});
Boolean isEnabled = results[0];See Also: UTIL_FeatureFlag
Methods
| Method | Description |
|---|---|
| global static List<Boolean> isEnabled(List<String> flagNames) | Returns if the specified feature flag is enabled for the current user. |
isEnabled
apex
@InvocableMethod(category='Utilities' description='Returns true if the specified Feature Flag is enabled for the current user.' label='Is Feature Flag Enabled') global static List<Boolean> isEnabled(List<String> flagNames)Returns if the specified feature flag is enabled for the current user.
Parameters
| Parameter | Type | Description |
|---|---|---|
flagNames | List | The API names of the feature flags to check, one per Flow interview. |
Returns Boolean — One Boolean for each name, in the same order: true when that flag is enabled for the current user.
Example
apex
List<Boolean> results = FLOW_CheckFeatureFlag.isEnabled(new List<String>{'NewDashboard', 'BetaFeature'});
if(results[0])
{
LOG_Builder.build().info('NewDashboard feature is enabled').emitAt('MyFlow.checkFlag');
}