I am trying to remove the json key in my output file. What is the best approach to do this? not sure how to achieve this. I want to return the array of data with all values. Not necessarily 1 value.
This is a link to my N8N post: Manipulate JSON File Structure to endpoint
below is my structure
current output:
{
"data": [
{
"id": 21428
}
]
}
and i want to remove {"data": to get this outcome.
[
{
"id": 21428
}
]
i have tried changing my item list to split output but no success.
You can simply reassign the output with the value of data
object:
output = output.data;
let output = {
"data": [
{
"id": 21428
}
]
};
output= output.data;
console.log(output);