A multiselect area is stored as text, so it takes its chosen keys as a JSON-encoded string, not as an array. It reads back as that same string in areasContent; areaValues(name) gives you the list.
Answer
API requests
A multiselect area answers 422 "Unexpected associative array encountered"
JavaScript
"areaContent(colours)": ["red", "blue"] // 422 Unexpected associative array encountered
"areaContent(colours)": "[\"red\",\"blue\"]" // stored
// in code
body.patchRevision['areaContent(colours)'] = JSON.stringify(['red', 'blue']);
// reading it as a list
// ?properties={id,colours:areaValues(colours)}
The value each input type takes, and how it reads back, is in Writing areas. On custom entity records area values are not validated, so a wrong key is saved rather than refused.
In the API reference: Edit a page.
More in API requests
Was this page helpful?
Your answer goes to the docs team.