Hi everyone,
A new n8n user here trying to understand the platform (no prior knowledge in alternatives / code)
I am trying to send the a JSON to ChatGPT to analyze and categorize a list of emails by 2 categories: Work / Personal, and have the output sent via gmail.
My problem:
When I am adding the object that includes the emails (workemails) // [personalemails]
The text is presented as a long string.
I researched multiple ways to split the string but it either didn’t work or was too complicated for me to understand based on the information at hand.
In the example screenshot you can see I have added an object to the email that includes 2 values:
- Welcome to Claude - Let’s get started
- Security Alert.
Lastly, adding the ChatGPT prompt below:
Go through this email summary and identify the email category. personal or work. Name each email by {{ $json.data[1].Subject }}
Have at least 2 emails in Personal Emails.
Use this format to output
{
“workemails”: [
“work 1”,
“work 2”,
“work 3”
],
“peronsalemails”:
[
“personal 1”
“personal 2”
“personal 3”
]
}
Input Data:
{{ $json.data.toJsonString() }}
PS.
Idk if it matters, but I took a template that does something similar and adjusted it.
Thank you.