Create a custom field property

Is there a way to add a custom field property via API?
I would like my contentType to have something like:

{...
"fields": [
  {
    "id": "someField",
    "name": "Some field",
    "type": "Symbol",
    "localized": true,
    "required": false,
    "validations": [],
    "disabled": false,
    "omitted": false,
    "customField": true
  }
],
"sys": ... }

Could you clarify what you would want to use this field for? There might be another solution for what you want.

I would like to have a field which is localizable, but not translatable. In other words: I would like to have a way to filter out fields which I should not send for translation to an external service.

Would be great if there were some metadata either for a field, or for a entire contentType.

Is that possible that contentful could provide this API:

{...
"fields": [
  {
    "id": "someField",
    "name": "Some field",
    "type": "Symbol",
    "localized": true,
    "required": false,
    "validations": [],
    "disabled": false,
    "omitted": false,
    "metadata": {}
  }
],
"sys": ... }

where metadata is ANY

What you could try is to add another (non-editable) field in your content type and add extra metadata in there. Data for this field could be generated with a UI Extension. I’m not sure if I understand the question correctly. Do you write the script for sending the translation yourself?

Thank you for the reply.
Yes, most probably we will go with the approach of attaching a hidden field and store the metadata in there. But semantically, properties I want to attach are related to the Content Type and its fields (not to the Entry!).
I expect Contentful API to allow to set some either metadata or tags

Hi! Any updates on this?

Hey you could use my blank field boilerplate:

look at src/components/Field.tsx …

The entry object meta is here:
const entryMeta = props.sdk.entry.getSys();
output to console.log(entryMeta); to find the meta you want.

Then maybe try setting use:
const [value, setValue] = useState(entryMeta.somefield || []);

Then, add “readOnly={true}” to the TextInput

<TextInput
          width="large"
          type="text"
          id="my-field"
          testId="my-field"
          value={entryMeta.somefield}
          onChange={onChange}
readOnly={false}
      />

Untested! But that should give you enough to play around with :slight_smile: