Issues when updating from CLI

Hi, I’m building an app to translate content from EN to FR. I have an structured text written in ENGLISH with some blocks inside (images), when I want to make an update to this record in order to put content in FR y receive this error: {"field":"content.fr","code":"INVALID_FORMAT","message":"Invalid block record ID: 99653916. It does not belong to the Item"}). That’s because I want to have the same blocks inside EN and FR but different text. How can I solve this? My code looks like this:

await client.items.update(item.id, {
  content: {
    en: item.content.value,
    fr: frContent,
  }
});

Hello @julian1

Assuming you have a structured text with some blocks inside, both the structured text, and the blocks have a different syntax to update than plain text fields:
Here is the documentation on the block update syntax: Update a record - Record - Content Management API

Let me know if that solves your problem!

1 Like