# 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

udf = management.udf.set(
    targetType='USER', # The target type is user
    key='school', # key is school
    dataType='STRING', # Data type is string
    label='School', # The label displayed is the school
)

udf = management.udf.set(
    targetType='USER', # The target type is user
    key='age', # key is age
    dataType='NUMBER', # data type is number
    label='age', # displayed label is age
)

# 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

management.udf.remove(
    targetType='USER', # The target type is user
    key='school' # key is school
)

# 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

udfs = management.udf.list(
  targetType="USER" # The target type is user
)