Feedback: How to configure an array field in the data screen #490

Closed
opened 2026-10-05 02:49:55 +02:00 by adam · 3 comments
Owner

It appears that the documentation either lost content or omits how to configure arrays in the data screen. I have the following configuration in data/files/kurzschnitte.json:

{
  "$schema": "https://frontmatter.codes/config/data.files.schema.json",
	"id": "kurzschnitte",
	"title": "Kurzschnitte",
	"file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json",
	"fileType": "json",
	"labelField": "title",
	"singleEntry": false,
	"schema": {
		"title": "Kurzschnitte",
		"type": "object",
		"required": [
			"title",
			"link",
			"slug"
		],
		"properties": {
			"title": {
				"type": "string",
				"title": "Title"
			},
			"link": {
				"type": "string",
				"title": "Link"
			},
			"description": {
				"type": "string",
				"multiline": true,
				"title": "Description"
			},
			"labels": {
				"type": "array",
				"items": {
					"type": "string"
				}
			},
			"slug": {
				"type": "string",
				"title": "Kurzschnitt-Post"
			},
		}
	}
}

The screen shows the Labels field, but nothing happens on click. I would expect a string field to be added.

The documentation has nothing about array types that I can find. The samples also contain only string fields, so the label configuration is something I have from a config file from around 1 or 2 years ago.

What is the proper way to configure array fields?

It appears that the documentation either lost content or omits how to configure _arrays_ in the data screen. I have the following configuration in `data/files/kurzschnitte.json`: ```json { "$schema": "https://frontmatter.codes/config/data.files.schema.json", "id": "kurzschnitte", "title": "Kurzschnitte", "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json", "fileType": "json", "labelField": "title", "singleEntry": false, "schema": { "title": "Kurzschnitte", "type": "object", "required": [ "title", "link", "slug" ], "properties": { "title": { "type": "string", "title": "Title" }, "link": { "type": "string", "title": "Link" }, "description": { "type": "string", "multiline": true, "title": "Description" }, "labels": { "type": "array", "items": { "type": "string" } }, "slug": { "type": "string", "title": "Kurzschnitt-Post" }, } } } ``` The screen shows the Labels field, but nothing happens on click. I would expect a string field to be added. The documentation has nothing about array types that I can find. The samples also contain only string fields, so the label configuration is something I have from a config file from around 1 or 2 years ago. What is the proper way to configure array fields? <!-- github-sync-id:1849720748 -->
adam closed this issue 2026-10-05 02:49:55 +02:00
Author
Owner

@davidsneighbour I'm facing the same issue. I posted my question on Discord because I don't know if the issue is with me or a bug with FrontMatter.

I've added my fields directly inside the JSON file to see if the FrontMatter UI would pick them up. It does. Through the UI, I can remove existing items belonging to an array as well as delete them, but I can not add more items.

If you're on Discord, here's the thread I started: https://discord.com/channels/992409023607476224/1140404917845119097

@davidsneighbour I'm facing the same issue. I posted my question on Discord because I don't know if the issue is with me or a bug with FrontMatter. I've added my fields directly inside the JSON file to see if the FrontMatter UI would pick them up. It does. Through the UI, I can remove existing items belonging to an array as well as delete them, but I can not add more items. If you're on Discord, here's the thread I started: https://discord.com/channels/992409023607476224/1140404917845119097 <!-- github-comment-id:1677300770 -->
Author
Owner

Thanks @davidsneighbour and @djmtype; there seems to be something wrong with the array field. Will investigate this further.

Thanks @davidsneighbour and @djmtype; there seems to be something wrong with the array field. Will investigate this further. <!-- github-comment-id:1680109499 -->
Author
Owner

Found the issue. This should work as expected in the latest beta version.

Found the issue. This should work as expected in the latest beta version. <!-- github-comment-id:1680128506 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#490