Why is it impossible to add expressions to the Structured Output Parser

I have tried adding variables and expressions to the Structured Output Parser dynamically, but it’s not possible you cannot access ($json) or any variables at all.

Having this option enabled would significantly improve the platform’s usability, as others have noted before.

2 Likes

Hi @Live_Support,

The structured output parser is used to tell the model how to export the data. If you want a certain field to go in the output, write that in the prompt message. Something like this…

Prompt: Chat input {{ $(‘When chat message received’).item.json.chatInput }}
Name: {{ $json.Name }}

The json in the output parser will look like this.

{
“name”: “name”
}

Hope this helps!

Robert Breen

1 Like

Here’s an example of how to pass the field to the output parser.

1 Like

Hi @Live_Support

Did this help you solve your issue?

Best,

Robert