Transfer then split the items from an array of JSON into sheet

Describe the problem/error/question

I use the AI for generating the idea from my provided direction. The flow, I give the AI one direction, it will give me ideas for 7 days and all of those ideas have the same properties including: Posting Date, Posting Time, Post per Day, Direction No., Content Brief, Design Brief.
The AI then returns a JSON like below. I don’t know how to transfer then split those items in the array into JSON, then into google sheet.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

I share on the next message because it’s over the text limit.
I need to make the output to the below sheet with each row is a single item from that AI’s output.

Information on your n8n setup

  • n8n version: Community 1.22.4
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows

One of the output is (Cannot type all because it’s limited. But other is the same with this)


[
{
"index": 
0,
"message": 
{
"role": 
"assistant",
"content": 
"[ { "Posting Date": "1/26/2024", "Posting Time": "2:00 PM", "Post per Day": "First", "Direction No.": 1, "Content Brief": "Post features our diverse video content genres including educational, podcasts, and engaging minigames centered around the Cardano ecosystem. *Suggested Topic*: 'Experience Multi-dimensional Learning with Cardano'.", "Design Brief": "An appealing visual collage featuring different video thumbnails reflecting the diverse genres. Imagery should be vibrant and engaging.", "Expectation": "Reach out to tech enthusiasts, learners looking for engaging educational content, and gamers. Drive engagement, provoke curiosity and increase viewership." }, { "Posting Date": "1/27/2024", "Posting Time": "10:00 AM", "Post per Day": "First", "Direction No.": 2, "Content Brief": "Reiterate our commitment to industry-standard costing, transparency in fund allocation, and meticulous reporting. *Suggested Topic*: 'Investing in Transparency and Trust with Cardano'.", "Design Brief": "Resourceful infographic showing the fund allocation process and reporting. It should evoke trust and professionalism.", "Expectation": "Reach out to potential voters, online investors. Drive trust and transparency and increase voting tendencies." }, { "Posting Date": "1/28/2024", "Posting Time": "9:00 AM", "Post per Day": "First", "Direction No.": 3, "Content Brief": "Debunk misconceptions about Cardano, focusing on its potential and efficiency. *Suggested Topic*: 'Debunking Myths, Revealing Truths about Cardano'.", "Design Brief": "Graphical illustrations debunking common myths with quick truths about Cardano. Design should be clear and appealing.", "Expectation": "Reach a wider audience, dispel myths, inspire trust and reaffirm users' belief." }, { "Posting Date": "1/29/2024", "Posting Time": "10:00 AM", "Post per Day": "First", "Direction No.": 4, "Content Brief": "Highlight team’s professional expertise, work ethic, low cost, and clear working process. *Suggested Topic*: 'Cardano: A Blend of Professional Prowess and Trust'.", "Design Brief": "Creative visuals of the team at work, mixed with graphics emphasizing cost-effectiveness, clear process, and outcome. Maintain a professional look and feel.", "Expectation": "Impress potential investors with the team's expertise. Inspire confidence and trust." }, { "Posting Date": "1/30/2024", "Posting Time": "4:00 PM", "Post per Day": "First", "Direction No.": 5, "Content Brief": "Promote the Cardano community as an inclusive, growth-driven platform. *Suggested Topic*: 'Your Growth, Our Passion: The Cardano Community'.", "Design Brief": "Showcase a diverse and vibrant community of Cardano users, emphasizing the opportunities for growth and learning.", "Expectation": "Encourage participation within the Cardano community, inspire existing members to engage more, and attract new members." }, { "Posting Date": "1/31/2024", "Posting Time": "3:00 PM", "Post per Day": "First", "Direction No.": 6, "Content Brief": "Celebrate the simplicity and accessibility of Cardano to all ages. *Suggested Topic*: 'Jump into Cardano: Easy, Engaging, and Empowering'.", "Design Brief": "Showcase an easy, interactive guide or infographic to navigating Cardano, making it appealing and non-intimidating to beginners.", "Expectation": "Attract new potential users of all ages, help beginners navigate the Cardano ecosystem." } ]"
},
"logprobs": 
null,
"finish_reason": 
"stop"
},
{
"index": 
0,
"message": 
{
"role": 
"assistant",
"content": 
"[ { "Posting Date": "Monday", "Posting Time": "9:00 AM", "Post per Day": "1", "Direction No.": "$json[1]", "Content Brief": "This post should introduce the concept of Cardano and why it's a revolutionary blockchain project. Highlight its scalability, interoperability, and sustainability.", "Design Brief": "Use visuals that symbolize high-tech and innovation. Infographics could be an effective way to illustrate the unique features of Cardano.", "Expectation": "The target audience is crypto enthusiasts and potential investors. They are expected to gain a better understanding of Cardano and consider investing." }, { "Posting Date": "Tuesday", "Posting Time": "11:00 AM", "Post per Day": "1", "Direction No.": "$json[2]", "Content Brief": "This post will delve into the brand message of Cardano: setting a new decentralized standard for the world's economy. Explain the idea of democratizing finance through blockchain technology.", "Design Brief": "Use symbolic visuals such as a globe or diverse group of people to represent the democratic nature of Cardano. Add wallet icons to represent the economic aspect.", "Expectation": "Crypto community members and potential investors are targeted. They should understand Cardano's mission and express interest in joining the campaign." }, { "Posting Date": "Wednesday", "Posting Time": "3:00 PM", "Post per Day": "1", "Direction No.": "$json[3]", "Content Brief": "This post will feature the unique selling point of Cardano: a comparative analysis with other blockchains, highlighting Cardano's superior technological framework.", "Design Brief": "Use a side-by-side comparison design, with Cardano on one side and other blockchain projects on the other. Highlight Cardano's advantages.", "Expectation": "Crypto community members, existing and potential Cardano investors should recognize Cardano's unique selling point and be encouraged to support the project more." } ]"
},
"logprobs": 
null,
"finish_reason": 
"stop"
}
]

Hey @mivtool,

You can use a set node to extact the content and turn it into an array then use a split out node to break it up into items so you can use them. The workflow example below uses your data in the code node then shows how you can extract the data to use it, give it a bash and let me know how you get on.

Thanks @Jon
Got your way. It seem better than a lot what I done yesterday with a lot of text in the script.
Btw, ChatGPT can deliver other structure of table, I just want to share the other below.

1 Like

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