# Custom fields This topic describes how to add custom fields using the Rebilly UI. To add custom fields using the Rebilly API, see the [Custom fields](/docs/dev-docs/api/custom-fields/) operations. Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. Depending on the resource on which the custom field is added, it will be available in all related forms and also as a filter in data table segments. Example: A custom field called 'Preferred contact method' is added to the customer resource. It has two allowed values, which are 'email' and 'phone'. When new customers are added, they will be prompted to provide this information. Alternatively, if the customer is manually added, a field for this value is provided. The custom field is also provided as a filter in data tables. ## Create custom fields Use this process to create custom fields. 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Press **Create custom field**. 4. In the **Resource** dropdown, select the resource you want to associate with the custom field. For example, if you want to add a preferred contact method field to customers, select the 'Customers' resource. 5. In the **Type** dropdown, select the format of the data. For example, if you want to store preferred contact information that contains alphanumeric data, select 'String'. 6. In the **Label** field, enter a name for the custom field. 7. In the **Description** field, enter a description for the custom field. 8. Optionally, to restrict the available input values, select the **Apply value restrictions** checkbox and enter the allowed values. For example, for the preferred contact method, you may want to add 'Email' or 'Phone'. Note: Restrictions are only available for `array` and `string` data types. 9. Use the **Preview** section to visualize how the custom field is displayed. 10. Optionally, to set a default value, in the **Default value** field, enter a value. 11. Optionally, to make the custom field required, select the **Required** checkbox. 12. Press **Save custom field**. ## Edit custom fields This process describes how to edit custom fields. 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Select a custom field. 4. Edit the custom field, then press **Save custom field**. ## Deactivate custom fields This process describes how to deactivate and activate custom fields. When a custom field is deactivated it is not displayed when creating or editing a resource unless the custom field already contains a value. If the custom field contains a value, it is displayed but it is not possible to add new values to the custom field. When a resource that is associated with a deactivated custom field is updated the custom field is removed from the resource. 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Locate the custom field. 4. In the **Status** column, turn the toggle on or off. ## Filter data table content by custom fields This process describes how to filter data table content based on a custom field. To filter data table content by a custom field, the custom field must be on the same resource. For example, if you want to filter 'customers' data table content by a custom field, the custom field must be on the customer resource. 1. Create a custom field 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Press **Create custom field**. 4. In the **Resource** dropdown, select the resource you want to associate with the custom field. For example, if you want to add a preferred contact method field to customers, select the 'Customers' resource. 5. In the **Type** dropdown, select the format of the data. For example, if you want to store preferred contact information that contains alphanumeric data, select 'String'. 6. In the **Label** field, enter a name for the custom field. 7. In the **Description** field, enter a description for the custom field. 8. Optionally, to restrict the available input values, select the **Apply value restrictions** checkbox and enter the allowed values. For example, for the preferred contact method, you may want to add 'Email' or 'Phone'. Note: Restrictions are only available for `array` and `string` data types. 9. Use the **Preview** section to visualize how the custom field is displayed. 10. Optionally, to set a default value, in the **Default value** field, enter a value. 11. Optionally, to make the custom field required, select the **Required** checkbox. 12. Press **Save custom field**. 2. Apply the custom filter to data table content 1. In the left navigation bar, press , depending on the resource in which you created the custom field, select **Customer**, **Payments**, **Billing**, **Logs**, or **KYC & AML**. 2. In the top right of the table, press . 3. Press **Add filter**. 4. In the **Filter** dropdown, type `custom fields`, then select your custom field. 5. In the **Operation** dropdown, select a condition. 6. In the **Value** field, enter or select values. For example to filter by customers aged between 30 and 40, using the custom field `Age`, select the `is between` operation, then in the **Value** fields, specify the range. 7. Press **Apply filter**. 8. Select an option: - To save the filtered data to the active segment: Press **Save**. - To create a new segment based on the filtered data: Press **Save segment as**, enter a name for the new segment, then press **Save**. A segment is a filtered view of the data set. Depending on where the filtered view is created, new segments are displayed in **Customer**, **Payments**, **Billing**, or **Logs**. For more information, see [Segments](/docs/settings/segments). ## Use custom fields as conditions in automations This process describes how to use a custom field as a condition on an automation. Conditions are used to specify additional criteria on when an automation is triggered, and also to target specific resources. 1. Create a custom field 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Press **Create custom field**. 4. In the **Resource** dropdown, select the resource you want to associate with the custom field. For example, if you want to add a preferred contact method field to customers, select the 'Customers' resource. 5. In the **Type** dropdown, select the format of the data. For example, if you want to store preferred contact information that contains alphanumeric data, select 'String'. 6. In the **Label** field, enter a name for the custom field. 7. In the **Description** field, enter a description for the custom field. 8. Optionally, to restrict the available input values, select the **Apply value restrictions** checkbox and enter the allowed values. For example, for the preferred contact method, you may want to add 'Email' or 'Phone'. Note: Restrictions are only available for `array` and `string` data types. 9. Use the **Preview** section to visualize how the custom field is displayed. 10. Optionally, to set a default value, in the **Default value** field, enter a value. 11. Optionally, to make the custom field required, select the **Required** checkbox. 12. Press **Save custom field**. 2. Create an automation on an eventThis step describes how to create an automation that is triggered when a specific event occurs. 1. In the left navigation bar, press . 2. In the **Rules engine** section, press **Rules engine**. 3. Press **Core events** or **Billing events**. 4. Select an event. 5. Press **Rule set**, then press **Create rule**. 6. In the **Name** field, enter a unique name to help differentiate between multiple rules. 7. Optionally, to add labels that help you identify the rule: In the **Labels** field, add one or more labels. 8. Optionally, to not stop further processing after this rule is executed: clear the **Stop further processing** checkbox. 3. Configure a condition using a custom fieldThis step describes how to configure a condition that is based on a custom field. 1. In the **Conditions** section, clear the **No conditions** checkbox. 2. In the **Select filter** field, select a custom field based condition that you want to apply. To view all available custom fields that are available on the event you have selected, in the **Select filter** field, type `custom fields`. Then select the custom field, the operation, and the value. Examples: - 'Transaction > Customer > Custom fields > 'Field name''. - 'Payment card > Customer > Custom fields > 'Field name''. - 'Invoice > Customer > Custom fields > 'Field name''. 3. In the **Actions** section, press **Add action**. 4. Specify the action that you want to occur when the condition is met. 5. Press **Save rule**. ## Use custom fields as conditions in email notifications This process describes how to use a custom field as a condition in an email notification. Conditions specify additional criteria for when an email is sent. For example, you can create an email notification that is sent to customers who sign up for a subscription and have selected the custom field value 'Opt-in for marketing emails'. 1. Create a custom field 1. In the left navigation bar, press . 2. In the **Management** section, press **Custom fields**. 3. Press **Create custom field**. 4. In the **Resource** dropdown, select the resource you want to associate with the custom field. For example, if you want to add a preferred contact method field to customers, select the 'Customers' resource. 5. In the **Type** dropdown, select the format of the data. For example, if you want to store preferred contact information that contains alphanumeric data, select 'String'. 6. In the **Label** field, enter a name for the custom field. 7. In the **Description** field, enter a description for the custom field. 8. Optionally, to restrict the available input values, select the **Apply value restrictions** checkbox and enter the allowed values. For example, for the preferred contact method, you may want to add 'Email' or 'Phone'. Note: Restrictions are only available for `array` and `string` data types. 9. Use the **Preview** section to visualize how the custom field is displayed. 10. Optionally, to set a default value, in the **Default value** field, enter a value. 11. Optionally, to make the custom field required, select the **Required** checkbox. 12. Press **Save custom field**. 2. Create an email notification with custom field as a condition 1. In the left navigation bar, press . 2. In the **Data and alerts** section, press **Email notifications**. 3. In the **Customer notifications** section, press **Core events** or **Billing events**. 4. Select an event. 5. In the top right of the page, press **Create email notification**. 6. In the **Name** field, enter a unique name to help differentiate between multiple notifications. 7. Optionally, to add labels that help you identify the notification: In the **Labels** field, add one or more labels. 8. In the **Conditions** section, clear the **No conditions** checkbox. 9. In the **Select filter** field, type `custom fields`, then select the custom field. 10. Specify the operation and value for the custom field. 11. In the **Emails** section, press **Add email**. 12. In the **Title** field, enter a meaningful title. 13. In the **From** field, select your email address. If your email address is not listed, press **Add email address**. 14. In the **To** field, add a placeholder or an email address. 15. Optionally, to stay informed on all emails, press **Add BCC** and add your email or a support email. 16. In the **Subject** field, enter a subject or placeholder. 17. In the **Email content** field, compose your email. Press **Add placeholders** to add dynamic event-based content. For example, a placeholder to fetch the email address of a customer is `{{subscription.customer.email}}`. The email can be in plain text or HTML. 18. Press **Save notification**. ## Related topics - [Add a customer](/docs/data-tables/manage-customer-information#add-a-customer) - [Apply a filter](/docs/data-tables/customize-tables#apply-a-filter-to-data-table-content) - [Extend resources](/docs/dev-docs/concepts#extend-resources) - [Customize data tables](/docs/data-tables/customize-tables)