diff --git a/docs/platform/advanced-targeting/custom-properties.md b/docs/platform/advanced-targeting/custom-properties.md index 381b8418..36c5c9d3 100644 --- a/docs/platform/advanced-targeting/custom-properties.md +++ b/docs/platform/advanced-targeting/custom-properties.md @@ -144,3 +144,36 @@ You can target users in numerous ways using Custom Properties. The following lis **Special Users**. Sometimes organizations want to release a feature to special users only, such as users with a paid membership, those with a free trial, or those who have made large contributions to the company. In this case, some property name suggestions are `accountType` `pricingPlan` `isSubscriber` `isTrialUser` `amountContributed` etc. **User Behaviour or Preferences.** You can experiment on users based on their behaviour or preferences. Some examples include `numberOfPageVisits` `gaveConsent` `preferredColor` etc. + +## Custom Property Schemas + +Similar to [Variable Schemas](/platform/advanced-variables/variable-schemas.md), Custom Property Schemas allow you to set up a schema and define a list of possible values for a Custom Property, which will appear in a dropdown when setting up Targeting Rules. Labels can be defined for each value to make selections more human-readable and easier to identify. This removes the need to remember valid inputs for a specific custom property. + +At DevCycle, we pass each organization's ID as a Custom Property that we use to turn on Features for specific customers. Schemas allow us to set up allowable organization ID values, along with their human-readable names, which makes it easy to set up Targeting Rules without needing to double-check for a correct organization ID. + +![Custom Property Schema Targeting Rule](/oct-2024-cust-prop-schema-targ-rule.png) + +### Setting Up a Custom Property Schema + +You can find a list of all existing Custom Properties in the Project Settings section of your [Settings page](https://app.devcycle.com/r/settings). + +![Custom Property Section on Settings Page](/oct-2024-cust-prop-settings-page.png) + +To add a schema to a Custom Property, click on the Custom Property you want to modify. On the Custom Property Details page, locate the Schema section. Schemas can be added to Custom Properties that are already in use. + +![Schema Section on Details Page](/oct-2024-schema-on-cust-prop-det-page.png) + +From there, select an Enum Schema from the dropdown. This allows you to specify allowable values for string or number properties. + +If you want to require this property to be set when passing custom data to the SDK, click the toggle icon next to Property Required. *Note: currently, this only affects the output of our [type generators](/sdk/client-side-sdks/javascript/javascript-typescript). + +Once you select an Enum Schema type, define the allowable values in the Allowed Values section below. + +If desired, you can turn on the Allow Additional Values setting, which will permit additional values to be used in Targeting Rules that aren't directly defined in that Custom Property's schema. + +For example, if you defined three options—Alberta, Quebec, and Ontario—in the Allowed Values section and toggled this option on, you wouldn’t be limited to those three values, even though they appear in the Custom Property value dropdown. + +![Custom Property Schema Targeting Rule](/oct-2024-cust-prop-schema-filled.png) + +Once you save your changes and apply the schema to the Custom Property, a dropdown with the allowed values will be available when setting up Targeting Rules for that Custom Property. + diff --git a/static/oct-2024-cust-prop-half-fill.png b/static/oct-2024-cust-prop-half-fill.png new file mode 100644 index 00000000..1cd03810 Binary files /dev/null and b/static/oct-2024-cust-prop-half-fill.png differ diff --git a/static/oct-2024-cust-prop-schema-filled.png b/static/oct-2024-cust-prop-schema-filled.png new file mode 100644 index 00000000..dc77cb06 Binary files /dev/null and b/static/oct-2024-cust-prop-schema-filled.png differ diff --git a/static/oct-2024-cust-prop-schema-targ-rule.png b/static/oct-2024-cust-prop-schema-targ-rule.png new file mode 100644 index 00000000..34234040 Binary files /dev/null and b/static/oct-2024-cust-prop-schema-targ-rule.png differ diff --git a/static/oct-2024-cust-prop-settings-page.png b/static/oct-2024-cust-prop-settings-page.png new file mode 100644 index 00000000..dc99d317 Binary files /dev/null and b/static/oct-2024-cust-prop-settings-page.png differ diff --git a/static/oct-2024-schema-on-cust-prop-det-page.png b/static/oct-2024-schema-on-cust-prop-det-page.png new file mode 100644 index 00000000..2c677e36 Binary files /dev/null and b/static/oct-2024-schema-on-cust-prop-det-page.png differ