Contentful logo

Contentful Community

Filtering fields by field properties (localized: true)

Hi there!

I’ve been trying to use queries to retrieve only the fields that have the property localized: true. This is something that exists in the data model, but for some reason I haven’t managed to find a way of retrieving fields that meet this condition, only to create fields with this condition.

I’ve tried it using the Contentful CLI tools without success and then tried it in Ruby with both CMA and CDA, but the only information I am getting for the fields is an array with the field id and field name.

This is the content model I am referring to:

{
  "name": "Product",
  "description": null,
  "displayField": "productName",
  "fields": [
    {
      "id": "productName",
      "name": "Product name",
      "type": "Text",
      "localized": true,
      "required": true,
      "validations": [],
      "disabled": false,
      "omitted": false
    },
    ...
}

Is there any way of retrieving fields that meet a certain condition based on these properties (more specifically the localized: true property)? (preferably using the CLI tools but otherwise Ruby would work too)

Thank you in advance!

Flavia