OCR and Node Code error

Dear,

I follow this template to use OCR to save data on Vector Store,

On the node “Code”, i get message error:

Where is the problem please? What is the equivalent python code?
Of more, i need to use Http request to use OCR before save on VectorStore or there are Nodes can be use to detect characters by OCRs?

Information on your n8n setup

  • **n8n version:1.98.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
  • **Operating system:Win10

Hey @jamal ,

Try to replace the first line of code with the following:-

$("Mistral DOC OCR").item.json.pages ;

and the run again, and let me know if it works or not .

: )

I set your line:

Hey @jamal , yes yes it will show that red line in code but no worries it does not affect anything.

Please try to run this and add a trigger node before starting the workflow as I am able to see the error you got now is because you have not attached trigger node before running this node.

Dear, i get this message:

Hey @jamal ,

Let’s do one thing. Please share the 2 nodes with me, let me have look at my side.

Follow these steps:-

  1. First Open Mistral Doc OCR node and pin the output
  2. Then copy this node as well the code node.
  3. Paste these node over here.

I will have a look at this my side…

This way we can quickly solve this !

Finally, i use this code:

const data = $json.pages ;

return data.map(entry => ({
  json: {
    markdown: entry.markdown
  }
}));

it’s works fine now.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.