Create a Global Field

To understand how to use Global fields, let us try and create the “Address” Global field such that it can be used to enter address details of multiple employees within an organization.

Consider that the “Address” Global field consists of the following fields:

  • House No
  • Apartment Name
  • Street Name
  • City
  • Postal Code

All the entries in the “Address” Global field will share the same attributes, however, they will have different content.

To create a Global Field, log in to your Contentstack account, go to your stack, and perform the following steps:

  1. Click on the “Content Models” icon on the left navigation panel, and select Global Fields at the bottom.
  2. Click on +New Global Field, this will direct you to the Create New Global form as shown below:Create_a_global_field_1_no_highlight.png

  3. Name the Global field Address and provide a suitable Description.Create_a_global_field_2_no_highlight.png

    Tip: Refer to the Restricted keywords for UIDs section to understand which keywords cannot be used as UIDs for Global fields.

  4. Click on Proceed.

Now that you have created the Global field, let us add fields and modify its properties as per your requirements.

The Global Field Builder page does not contain any fields by default. We will add fields such as “House Number,” “Apartment Name,” “Street Name,” “City,” and “Postal Code.”

To add custom fields to your Global field, click on the “Insert a field” icon and select the fields from the Fields list that appear.

Let us go through the steps to add each of these fields.

  1. For the House No field, use the Single Line Textbox field.
  2. Drag and drop the Single Line Textbox field for Apartment Name.
  3. Use the Single Line Textbox field for Street Name.
  4. Drag and drop the Single Line Textbox field for City.
  5. Finally, we will use the Number field for Postal Code.
  6. Click on either Save or Save and Close.

Modify the behavior of your added fields by clicking on the respective fields and editing their properties  which you can access by clicking on the “settings” gear icon.

Your finished “Address” Global field should be something similar to the following screenshot:


API Reference

To perform the Create action via API, refer to the Create a Global Field API request

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page