0

Understanding "Document Fields" structure from the API

Hi,

I'm trying to understand how to parse the response of the Retrieve All Document Fields API call. In particular, I'm interested in getting what taxonomy position a field applies to.

The challenge is that there's quite a bit of variability among items of the 'properties' array.

From what I get, the "shared" key will always be present with values "true" or "false", except for "id" and "version_id".

If shared == false, then the object always contains a single "definedIn" key, whose value can be parsed in its turn.

If shared == true, then the object usually contains a "usedIn" array with its own objects for each taxonomy position the field is used in.

However, I found 17 fields where shared == true, but there is neither a 'definedIn' or a 'usedIn' key. For instance:

enable_pdfa_rendition__v
change_summary__v
pages_ocred_percent__sys
obsolete_change_control__v
batch_number__v

I wonder what to make of these items. What does it mean for a field to be shared, but neither defined in or used in anything?

Thanks!

Raph

1 comment

  • Avatar
    Kevin N Official comment

    Hi Raph,

    Shared fields don't have to be defined in or used by any documents. The Admin -> Configuration -> Document Fields -> Shared Fields tab in your vault shows what user accessible fields are currently configured as Shared fields. These shared fields can either by added to various document types for use or not at all. Once configured on a document type, the shared field will update to display a "Used In" value.

    For example, I created a "test_shared_field__c" shared field in my vault that is not used in any document types. This field will display with no usedIn or definedIn property:

     {
    "name": "test_shared_field__c",
    "scope": "DocumentVersion",
    "type": "String",
    "required": false,
    "maxLength": 20,
    "repeating": false,
    "systemAttribute": false,
    "editable": true,
    "setOnCreateOnly": false,
    "disabled": false,
    "label": "Test Shared Field",
    "section": "generalProperties",
    "sectionPosition": 1000,
    "hidden": false,
    "queryable": true,
    "shared": true,
    "noCopy": false,
    "secureRelationship": false
    }

    For some of the shared __v or __sys fields (like enable_pdfa_rendition__v), these are backend settings or disabled vault features that cannot be accessed by users. These are part of the vault data model and are expected to show up in the API response.

     

    Thanks,

    Kevin N

Please sign in to leave a comment.