GenAI Node Entities cannot be used in If/Else Statement

Hi - I have set up a GenAI node and would like to use the entities pulled out by the node. However, the flow breaks any time I try to access the entities. Are there any workarounds? Below is the format I’m using when trying to display the entity:

{{context.ai_assisted_dialog.transferInformationCollector.entities.accountOrigin}}
I’ve also tried {{context.genai_node.transferInformationCollector.entities.accountOrigin}}

Per the screenshot below, I can see that the entity exists.

entities is an array of objects, not an object itself.

{{context.ai_assisted_dialog.transferInformationCollector.entities[0].accountOrigin}}

Figured out there were 4 issues –

*As @andy.heydon pointed out, the entities are an array (not an object)
*It should be AI_Assisted_Dialogs (not Dialog)
*The path is case sensitive
*The format of the JSON output from the GenAI node varies, so it’s important to write a post-processing script to clean it up

Hi @andy.heydon @elangovan.sanjay

as you said the “format of the JSON output from the GenAI node varies” is there any rule which determines the change (will it change node to node or it might change for a same node in 2 different runs)

also can you please suggest, (give a sample) what must be done in the post processing script