# Manage custom field metadata

Udf is the abbreviation of User Defined Field (User Defined Field). Authing data entities (such as users, roles, groups, organizations, etc.) can add custom fields. You can configure fields that Authing does not come with by default. For example, if you need to create a school-related application, you can add a custom field. `school` field. At the same time, you can ask the user to supplement the information of this field after the user registration is completed. For detailed documentation, please see https://docs.authing.co/extensibility/user/extend-register-fields.html.

# Set custom field metadata

UdfManagementClient().set(targetType, key, dataType, label)

Set custom field metadata, if the field does not exist, it will be created automatically.

# Parameters

  • targetType <UdfTargetType> Custom field target type, USER means user and ROLE means role.
  • key <string> field key
  • dataType <UdfDataType> data type, currently supports five data types. STRING is a character string, NUMBER is a number, DATETIME is a date, BOOLEAN is a boolean value, and OBJECT is an object.
  • label <string> The field Label is generally a Human Readable string.

# Example

UserDefinedField udf = managementClient.udf().set(UdfTargetType.USER, "key", UdfDataType.STRING, "label").execute();

# Delete custom fields

UdfManagementClient().remove(targetType, key)

Delete custom fields

# Parameters

  • targetType <UdfTargetType> Custom field target type, USER means user and ROLE means role.
  • key <string> field key

# Example

CommonMessage message = managementClient.udf().remove(UdfTargetType.USER, "key").execute();

# Get custom field definition

UdfManagementClient().list(targetType)

Query custom fields defined by user pool

# Parameters

  • targetType <UdfTargetType> Custom field target type, USER means user and ROLE means role.

# Example

List<UserDefinedField> list = managementClient.udf().list(UdfTargetType.USER).execute();