Global Fields

View as Markdown

Global Fields

A Global field is a reusable field or group of fields that you define once and reuse across any content type in your stack. This helps you avoid recreating the same set of fields multiple times, saving time and effort.

fetch

The fetch method retrieves data for the specified global field.

Example:

import contentstack
stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
global_field = stack.global_field('global_field_uid')
response = global_field.fetch()

find

The find method retrieves all global fields in the stack.

Example:

import contentstack
stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
some_dict = {'abc':'something'}
global_field = stack.global_field('global_field_uid')
response = global_field.find(param=some_dict)