Skip to main content
You find the context schema under Admin > Clients and the Context Schema tab. A context schema lets you map a field in the evaluation context of a feature flag to name and a data type. Context schemas let Confidence know what can exist in the evaluation context before Confidence has detected it. Confidence automatically keeps track of fields you include in your evaluation context and uses them to populate relevant options in the app. For example, when you define your target audience. Confidence by default maps the field visitor_id to the entity Visitor as this is an identifier the Confidence flag SDKs automatically emit. This means that when you create a rollout targeting the entity Visitor, Confidence randomizes treatment assignment based on the visitor_id value in the evaluation context of the feature flag.

Supported Value Types

In Create schema override, Value type combines primitive types and semantic types. A primitive type describes the JSON value. A semantic type adds meaning, such as a country code, to that value. Choose the type that matches the value your application sends in the evaluation context.

Primitive Types

"true", "42", and "null" are strings, not boolean, number, or null values.

Semantic Types

These types use JSON strings, except Entity, which follows the selected entity’s primary key type. The formats below follow the schema override form and use explicit date and time representations. For Enum, add the possible string values when you create the override. The form trims whitespace and removes duplicates from that list. For Entity, select the entity that the field identifies. Send the identifier, not the entity’s resource name or an object. The table lists schema formats, not every conversion the resolver can perform during targeting. For example, send a timestamp as the string shown above rather than relying on conversion from an epoch number. An override describes the field. It doesn’t change the JSON value your application sends.

Nested Fields and Lists

Use a dotted field path for a value inside an object. For example, an override for user.country describes the country string in this evaluation context:
Object and list aren’t separate value types in Create schema override. For list targeting, send a JSON array such as ["web", "mobile"], not a comma-separated string. See string and list matching for targeting behavior.

Mark Fields as Non-PII

You can mark context fields as not containing personally identifiable information. When you mark a field as non-PII, Confidence samples the values that your application sends for that field. This helps you in two ways:
  • Discover field values: See what values your application sends for a field.
  • Easier targeting: Get autocomplete suggestions when you create targeting rules.
Only mark fields as non-PII if they truly don’t contain personally identifiable information. Confidence samples and displays these values to help with targeting, so you must ensure the field doesn’t contain sensitive data like email addresses, phone numbers, or user IDs.

How Confidence Samples Values

Confidence collects sample values from flag resolution requests for fields marked as non-PII. Confidence only samples values when it detects that a field has low cardinality, which means the field has a limited set of distinct values. For example, fields like country, platform, or subscription_tier are good candidates. To protect user privacy, Confidence only includes a value in the samples if many users send that same value. If only a few users send a specific value, Confidence doesn’t sample it because the value might be specific to those users and could reveal identifying information. The sampled values appear as autocomplete suggestions when you create targeting rules. For example, if you mark the country field as non-PII, you see a list of countries that your application has sent, making it easier to create targeting rules.

Mark a Field as Non-PII

1

Go to Confidence

Navigate to Confidence.
2

Open Clients settings

On the left sidebar, select Admin and click Clients.
3

Select the client

Select the client you want to update.
4

Go to Context Schema

Go to the Context Schema tab.
5

Find the field

Find the field you want to mark as non-PII.
6

Mark as Non-PII

Select the checkbox in the Non-PII column for that field.
Confidence starts sampling values for this field during flag resolution.

Define Audience Criteria

Use context fields for targeting

Rules Reference

Understand how rules use context

Test Flag Resolution

Test context-based resolution

Entities Reference

Map context fields to entities