> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Field Type

> Change a DocumentEntity user-defined field's type based on the prog-id or label.



## OpenAPI

````yaml /openapi/rest/openapi-v3-Document.json post /api/v1/Document/UdefLayout/{progidOrLabel}/ChangeTo/{fieldType}
openapi: 3.0.0
info:
  version: v1-REST
  title: SuperOffice REST API v1
  description: SuperOffice REST API - Document
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Document/UdefLayout/{progidOrLabel}/ChangeTo/{fieldType}:
    post:
      tags:
        - Document
      summary: Change Field Type
      description: >-
        Change a DocumentEntity user-defined field's type based on the prog-id
        or label.
      operationId: v1DocumentEntity_ChangeFieldType
      parameters:
        - name: progidOrLabel
          in: path
          description: The udef field id, case-sensitive prog-id, or field label.
          required: true
          schema:
            type: string
        - name: fieldType
          in: path
          description: The new type of the user defined field.
          required: true
          schema:
            type: string
            enum:
              - Number
              - ShortText
              - LongText
              - Date
              - UnlimitedDate
              - Checkbox
              - List
              - Decimal
        - name: isIndexed
          in: query
          description: >-
            Should we put data in an indexed column for faster access? Default
            no
          required: false
          schema:
            type: boolean
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: DocumentEntity found.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
            application/xml:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
            text/xml:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
            application/json-patch+json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
            application/merge-patch+json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.CRM.Services.UserDefinedFieldInfo
        '404':
          description: DocumentEntity not found.
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.CRM.Services.UserDefinedFieldInfo:
      description: "Return information about the user defined fields. The information can be used to mirror the layout of the user-defined fields in the user interface.\r\n<para />\r\nCarrier object for UserDefinedFieldInfo.\r\nServices for the UserDefinedFieldInfo Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IUserDefinedFieldInfoAgent\">UserDefinedFieldInfo Agent</see>."
      type: object
      properties:
        UDefFieldId:
          format: int32
          description: Primary key
          type: integer
        ColumnId:
          format: int32
          description: The ID of the database column this field corresponds to
          type: integer
        FieldDefault:
          description: Optional default value for String fields
          type: string
        FieldHeight:
          format: int32
          description: field height in pixels, 0 = 'enough' (from font)
          type: integer
        FieldLabel:
          description: The label (lead text)
          type: string
        FieldLeft:
          format: int32
          description: X pixel coordinate of field
          type: integer
        FieldTop:
          format: int32
          description: Y pixel coordinate of field
          type: integer
        FieldType:
          description: >-
            Field type: 0 = leadtext only, 1 = Edit, 2 = CheckBox, 3 = dropdown,
            4 = listbox
          enum:
            - Number
            - ShortText
            - LongText
            - Date
            - UnlimitedDate
            - Checkbox
            - List
            - Decimal
          type: string
        FieldWidth:
          format: int32
          description: field width in pixels, 0 = 'enough' (from font)
          type: integer
        FormatMask:
          description: >-
            Formatting mask, can be whatever the controls understand (currently
            nothing :-))
          type: string
        HideLabel:
          description: Hide the label if 1
          type: boolean
        IsIndexed:
          description: Is this field indexed? 0 if no, index no. if yes
          type: boolean
        LabelHeight:
          format: int32
          description: label height in pixels, 0 = 'enough' (from font)
          type: integer
        LabelLeft:
          format: int32
          description: X pixel coordinate of label
          type: integer
        LabelTop:
          format: int32
          description: Y pixel coordinate of label
          type: integer
        LabelWidth:
          format: int32
          description: label width in pixels, 0 = 'enough' (from font)
          type: integer
        LastVersionId:
          format: int32
          description: >-
            UDefFieldId this field had in the previous version, 0 = field is new
            in this version
          type: integer
        ListTableId:
          format: int32
          description: >-
            The table ID of the source table for lists: kTableAssoc,
            kTableContInt or whatever
          type: integer
        IsMandatory:
          description: 0 = no, 1 = yes (field must be filled out)
          type: boolean
        Type:
          description: >-
            ID of owning table (contact, person, project) - this is not the
            actual tableNumber, rather it's an enum
          enum:
            - Invalid
            - Contact
            - Person
            - Project
            - Sale
            - Temp
            - Appointment
            - Document
            - None
          type: string
        Page1LineNo:
          format: int32
          description: >-
            Line no on View Page 1, used if MDO flags are OFF. 0 = this field is
            not visible on page 1
          type: integer
        ProgId:
          description: >-
            Programmatic ID, for use by software that needs to find a particular
            field. Carried over like udefIdentity across generations. Use a
            Company.Product.Field format to avoid naming conflicts; the Company
            name SuperOffice is reserved.
          type: string
        IsReadOnly:
          description: 0 = read/write, 1 = readonly (don't combine with mandatory  8-) )
          type: boolean
        ShortLabel:
          description: >-
            Short name to be used in Archive headings and on page 1. If blank,
            the fieldLabel will be used everywhere.
          type: string
        TabOrder:
          format: int32
          description: Tab order value, sets the field processing sequence
          type: integer
        TextLength:
          format: int32
          description: Length (in characters) of a text field, 0 for other types
          type: integer
        Tooltip:
          description: Optional tooltip text for this field
          type: string
        UdefIdentity:
          format: int32
          description: Unique number used to track field identity across layout changes
          type: integer
        UDListDefinitionId:
          format: int32
          description: List to use for populating dropdown or listbox
          type: integer
        Justification:
          description: Justification - 0 = default, left, right, center
          enum:
            - Default
            - Left
            - Center
            - Right
          type: string
        Version:
          format: int32
          description: >-
            Definition version number; ALL fields get new version whenever
            layout is updated.
          type: integer
        TemplateVariableName:
          description: Template variable name
          type: string
        HasBeenPublished:
          description: Has the udef field been published?
          type: boolean
        MdoListName:
          description: >-
            MDO list name used to populate this list. Derived from
            UDListDefinitionId and ListTableId. (Read-only)
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [Change Field Type](/en/api/reference/restful/rest/project/change-field-type.md)
