Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance (CCI)
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Adding a Field to an Object Instance

Updated on 2025-03-21 GMT+08:00

Function

This API is used to add required fields to custom object instances.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/{object_id}/Field

Table 1 URI parameter

Parameter

Mandatory

Type

Description

Object_id

Yes

String

Explanation

Object instance ID, which can be queried by calling the API of Querying All Custom Objects (id in the response message).

Constraints

None

Value

None

Default value

None

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Explanation

Name of the new field.

Constraints

The value cannot be changed after being specified.

Value

The value must start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_) and can contain a maximum of 63 characters.

Default value

None

label

Yes

String

Explanation

Label of the new field.

Constraints

None

Value

1–80 characters

Default value

None

inlineHelpText

No

String

Explanation

Description of the new field.

Constraints

None

Value

1–255 characters

Default value

None

dataLength

Yes

Int

Explanation

Length of new fields.

Constraints

None

Value

1–64 characters

Default value

None

dataType

Yes

String

Explanation

Type of the new field.

Constraints

The value cannot be changed after being specified.

Value

  • Text: You can enter a maximum of 255 characters, including any combination of letters and digits.
  • Encrypted Text: You can enter a maximum of 111 characters and store them in encrypted format, including any combination of letters and digits.
  • Text Area: You can enter up to 1,048,576 characters in multiple lines.
  • Number: You can enter any digit. Leading zeros are removed.
  • Percent: You can enter a percentage number, for example, 10, and the percent sign is automatically added to the number.
  • Phone: You can enter any phone number, which is automatically displayed in the phone number format.
  • Currency: You can enter amounts in other currencies, which will automatically be converted to the correct format. This function is useful when exporting data to Excel or other spreadsheets.
  • Date: You can enter a date or select a date from the calendar that is displayed.
  • Date/Time: You can enter a date and time or select a date from the calendar that is displayed. When you click a date in the calendar that is displayed, the date and current time are shown in this field.
  • Email: You can enter an email address. The system validates the email address format. If this field is specified for a contact or a potential customer, you can select an address when you send an email. Note that custom e-mail addresses cannot be used for bulk e-mail.
  • Checkbox: You can select a true (checked) or false (unchecked) value.
  • Picklist: You can select a value from a defined list.
  • Picklist (Multi-Select): You can select multiple values from a defined list.
  • URL: You can enter any valid URL. When you click this field, you will visit the URL in a separate browser window.
  • Lookup Relationship: You can create a relationship that associates this object to another object.
  • Auto number: The system generates serial numbers in the format that you define. The sequence number increases by one for each newly added record.
  • Formula: he system generates a read-only field in the formula expression that you define. If the source field used in any expression is changed, the value of this field will be updated.
  • Master Detail: You can create a type of primary/secondary relationship between one object and another. Ownership of detailed records is determined by the master record. When you delete the master record, all detailed records will be deleted.
  • Multiple Language: You can select content in multiple languages from the customized resource table.
  • Attachment: You can save the addresses of multiple uploaded files. Images and documents are supported.

Default value

None

description

No

String

Explanation

Description of the new field.

Constraints

None

Value

1–80 characters

Default value

None

defaultValue

No

String

Explanation

Default value of the new field.

Constraints

The format must comply with the rules of the type configured in the field type (dataType).

Value

None

Default value

None

caseSensitive

No

Boolean

Explanation

Whether the value is case sensitive. For example, If ABC and abc are considered equal, the setting is case insensitive. If they are treated as different, the setting is case sensitive.

Constraints

None

Value

  • true: The value is case-sensitive.
  • false: The value is case-insensitive.

Default value

false

isRequired

No

Boolean

Explanation

Whether the field is mandatory.

Constraints

None

Value

  • true: The field is mandatory.
  • false: The field is optional.

Default value

false

isUnique

No

Boolean

Explanation

Whether duplicate data is allowed in a field.

Constraints

None

Value

  • true: The field is unique.
  • false: The field is not unique.

Default value

false

profiles

No

Array

Explanation

Profiles assigned.

Constraints

None

layouts

No

Array

Explanation

Layout name of the field.

Constraints

None

view

No

Object

Explanation

Each item is a string array. The name is the layout of the field, and the content is the fields contained in the layout.

Constraints

None

isSearchable

No

Boolean

Explanation

Whether the search statement can be used to search for the field.

Constraints

None

Value

  • true: The field can be searched.
  • false: The field cannot be searched.

Default value

false

Response Parameters

Table 3 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, Success is returned. In other cases, an error message is returned.

result

string

Explanation

If the request is successful, an ID is returned.

Value

None

Example Request

To add a field to an object instance, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/cust000000aKoa6I4E6K/Field
{
    "label":"test",
    "name":"CNAME1__test__CST",
    "inlineHelpText":"dsf",
    "description":"fsdf",
    "dataType":"text",
    "dataLength":255,
    "defaultValue":"vfdsg",
    "caseSensitive":true,
    "isRequired":true,
    "isUnique":true,
    "isSearchable":true,
    "profiles":[
        {
            "profile":"000T0000000000000002",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T0000000000000003",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T0000000000000004",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T0000000000000006",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T000000Tiq6fUQhjK",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T000000Tiq6lJCs2y",
            "readable":true,
            "editable":true
        },
        {
            "profile":"000T000000W1a8iTFglU",
            "readable":true,
            "editable":true
        }
    ],
    "layouts":[
        "000D000000aKoa6OJOxk"
    ],
    "view":{
        "000D000000aKoa6OJOxk":{
            "fields":[
                "name",
                "test__df__CST",
                "test__sdadsd__CST",
                "test__sdd__CST"
            ]
        }
    }
}    

Example Response

{
  "resCode":"0",
  "resMsg": "Success",
  "result":"cust000000iY8i3Jvyng"
}

Status Code

See Status Codes.

Error Code

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback