works … mostly. I modified your Code node to somehow fit my use case (names etc):
I have this
const tickets = $('Fetch ticket').all();
const articles = $('Fetch articles').all();
for (const ticket of tickets) {
ticket.json.articles = articles
.filter(article => article.json.ticket_id === ticket.json.id)
.map(article => article.json)
}
return tickets;
but this returns the articles “inside” of the ticket.
My alternative solution formats it differently (and works with my converter):
const ticket = $('Fetch ticket').first().json;
let articles = $('Fetch articles').all()
articles = articles.map((article) => article.json)
return {
json: {
Ticket: ticket,
articles
}
}
Do you think my way is OK as well? Any recommendations? thanks