Object Object Error when using AI outputs

Hello, I am getting the [Object] [Object] error when using AI to write social content for me.

As you can see, simply the trigger gets a random article from my DB, which is fed into AI (ChatGPT) and then outputted to X and Linked in.

However, the outputs return random json strings, as you can see here…

I was wondering if there is a way to use a function to lock the output, like in excel when you use $, to lock a formula… how do I get a constant return of the data?

I have looked around here, and asked AI for help, but nothing has worked.

Thank you legends!

It would be insightful if you could pin some critical data to understand its structure and post the workflow using the </> button. It would make attempts to help here out less of a guesswork.
Here is how: Google sheet: data is replaced in the existing row instead of adding new row - #8 by Olek

If you want to avoid things like [undefined] appear when a specific field is only occasionally present in the output you can use expressions like {{ messages.content.whatever ?? ""}}. This will efectively add "" when a data point is not available.

[Object Object] appears when you try to put an object (a structure with fields) into a context where a string expected. This how Javascript deals with those situations. The good point to start is to use expressions like {{ JSON.stringify(data.field.whateverObject) }} to understand the structure, problem and if the output with special characters in it is deemed better than having nothing (i.e. [Object object]).

You may also want to use the Structured Output Parser node/tool:

If you find anything above helpful, please mark this post as a :white_check_mark: Solution.

Thank you, I have added a set node before the social outputs. I have tested it, and it seems to have worked. I will leave it a few hours to do it’s thing as sometimes the output works a few times then switches up.

1 Like

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