Skip to content
Developerhome
Sage Distribution and Manufacturing Operations

Operator to get a single custom property value

  Less than to read

A custom property can be extracted from _customField.

After extraction, you can rename the property. For example:

marketingDate: _customDate(selector:  "marketingDate")

The following table displays the resulting query after the renaming. Some of the fields displayed are not mandatory and others have been omitted.

{ 
  xtremMasterData{ 
    item{ 
      query (filter: "{_customData: { _ne: null}}"){ 
        edges { 
          node { 
            id 
            marketingDate:_customData(selector:"marketingDate") 
          } 
        } 
      } 
    } 
  } 
} 
{ 
  "data": { 
    "xtremMasterData": { 
      "item": { 
        "query": { 
          "edges": [ 
            { 
              "node": { 
                "id": "PIE_BLUEBERRY", 
                "marketingDate": "\"2023-08-17\"" 
                } 
            }
          ] 
        } 
      } 
    } 
  }, 
  "extensions": { 
    "diagnoses": [] 
  }
} 

Custom fields, regardless of their data type, are always presented as strings. This is constraint related to GraphQL.

To obtain the value of a custom field without using quotes, you can use functions such as JSON.parse in Javascript.