---
title: "GlobalField"
description: "GlobalField"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/globalfield"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-13"
---

# GlobalField

## GlobalField

A [Global field](/docs/headless-cms/about-global-field) is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack.  
A nested global field is a reusable group of sub-fields that you define once and embed within other global fields or content types. This allows for a more structured and scalable way to manage complex content models across your stack

Note: Pass api\_version 3.2 for nested global fields.

## update

The Update GlobalField call lets you update the name and description of an existing GlobalField.

```
Example 1: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).globalField('global_field_uid').fetch()
.then((globalField) => {
 globalField.title = 'My New global field'
 globalField.description = 'global field description'
 return globalField.update()
})
.then((globalField) => console.log(globalField))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).globalField('global_field_uid', { api_version: '3.2' }).fetch()
.then((globalField) => {
 globalField.title = 'My New global field'
 globalField.description = 'global field description'
 return globalField.update()
})
.then((globalField) => console.log(globalField))
```

## delete

The Delete GlobalField call is used to delete an existing GlobalField permanently from your Stack.

```
Example 1: 
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).globalField('global_field_uid').delete()
.then((response) => console.log(response.notice))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).globalField('global_field_uid', { api_version: '3.2'}).delete()
.then((response) => console.log(response.notice))
```

## fetch

The fetch GlobalField call fetches GlobalField details.

```
Example 1: 
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).globalField('global_field_uid').fetch()
.then((globalField) => console.log(globalField))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).globalField('global_field_uid', { api_version: '3.2'}).fetch()
.then((globalField) => console.log(globalField))
```

Version number to fetch specific version of GlobalField.

## create

The Create a GlobalField call creates a new globalField in a particular stack of your Contentstack account.

```
Example 1: 
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const global_field = {name: 'My New global field'}

client.stack({ api_key: 'api_key'}).globalField().create({ global_field })
.then((globalField) => console.log(globalField))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const global_field = {name: 'My New global field'}
client.stack({ api_key: 'api_key'}).globalField({ api_version: '3.2'}).create({ global_field })
.then((globalField) => console.log(globalField))
```

GlobalField details and schema to create.

## query

The Query on GlobalField will allow to fetch details of all or specific GlobalField

```
Example 1: 
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).globalField().query({ query: { name: 'Global Field Name' } }).find()
.then((globalField) => console.log(globalField))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).globalField({ api_version: '3.2'}).query({ query: { name: 'Global Field Name' } }).find()
.then((globalField) => console.log(globalField))
```

## import

The Import a global field call imports a global field into a stack.

```
Example 1: 
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const data = {
 global_field: 'path/to/file.json',
}

client.stack({ api_key: 'api_key'}).globalField().import(data)
.then((globalField) => console.log(globalField))
Example 2: 

import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const data = {
 global_field: 'path/to/file.json',
}
client.stack({ api_key: 'api_key'}).globalField({ api_version: '3.2'}).import(data)
.then((globalField) => console.log(globalField))
```

File path to import GlobalField

## GlobalField | JavaScript Management SDK | Contentstack

GlobalField lets you define a reusable field or group of fields once and apply it across content types in the JavaScript Management SDK.