Hi,
I am trying to write a migration to change a field from a number field to a text field in a block which is used in many different structured text fields.
I thought I could just do this:
// create size_temp field on breakpoint block
for await (const record of client.items.listPagedIterator({ filter: { type: 'breakpoint' }, nested: true }, {})) {
// Update block so the existing size is copied over to the new field
await client.items.update(record.id, {
...record,
size_temp: `${record.size}`
});
}
// Delete the old size field and rename size_temp.
The issue I have is doing this results in a 404 for some reason even though I can see the record exists when I log it out?
{
"data": [
{
"id": "302048",
"type": "api_error",
"attributes": {
"code": "NOT_FOUND",
"details": {}
}
}
]
}
I also tried to modify the field and convert it from numeric to a string but you can’t do that either…
{
"id": "398f8d",
"type": "api_error",
"attributes": {
"code": "INVALID_FIELD",
"details": {
"field": "field_type",
"code": "INVALID_FORMAT",
"message": "Cannot be converted into string"
}
}
}
Also just on this it would be nice too be able to get all items using the CMA based on field type.