JSON Array Collection Issue - Rows Not Populating in Google Sheets

What are you trying to achieve?

I am trying to get multiple diet inputs from Telegram analyzed by the HTTP module (Chat) into multiple data points for different food items (Calories, Time, Category etc). After that then take each food item and place into google sheet rows.

Steps taken so far

I have been able to get the data from telegram and analyzed by the http module. Then JSON converts it into bundles but the iterator module only captures 1 item because it is not in a array. Here is the JSON input
[
{
“json”: “[{"Date":"2025-05-20T00:39:51.031Z","Category":"Meal","Subcategory":"Food","Name":"1 grape","Calories":2,"Protein":0.02,"Carbs":0.5,"Fat":0.02},{"Date":"2025-05-20T00:39:51.031Z","Category":"Meal","Subcategory":"Food","Name":"6 oz chicken","Calories":350,"Protein":65,"Carbs":0,"Fat":7.5},{"Date":"2025-05-20T00:39:51.031Z","Category":"Fluid","Subcategory":"Juice","Name":"1 cup kale juice","Calories":34,"Protein":2.2,"Carbs":6.7,"Fat":0.5}]”
}
]

and here is the json output

[
{
“Date”: “2025-05-20T00:39:51.031Z”,
“Category”: “Meal”,
“Subcategory”: “Food”,
“Name”: “1 grape”,
“Calories”: 2,
“Protein”: 0.02,
“Carbs”: 0.5,
“Fat”: 0.02
},
{
“Date”: “2025-05-20T00:39:51.031Z”,
“Category”: “Meal”,
“Subcategory”: “Food”,
“Name”: “6 oz chicken”,
“Calories”: 350,
“Protein”: 65,
“Carbs”: 0,
“Fat”: 7.5
},
{
“Date”: “2025-05-20T00:39:51.031Z”,
“Category”: “Fluid”,
“Subcategory”: “Juice”,
“Name”: “1 cup kale juice”,
“Calories”: 34,
“Protein”: 2.2,
“Carbs”: 6.7,
“Fat”: 0.5
}
]

Screenshots: scenario setup, module configuration, errors

Hi Randolph_Nunez, your problem seems to be the use of Curly Quotes “ ” instead of Straight Quotes (") where are you getting this JSON from?

http post module that is analyzing the data here is the prompt i am using {
“model”: “gpt-3.5-turbo”,
“messages”: [
{
“role”: “system”,
“content”: “You are a JSON generator. Your task is to generate a clean JSON array of objects without any text or explanation. The JSON must always be in this structure:\n\n[\n {"Date": "2025-05-20T00:10:46.123Z", "Category": "Meal", "Subcategory": "Food", "Name": "Grape", "Calories": 2, "Protein": 0.02, "Carbs": 0.5, "Fat": 0.02},\n {"Date": "2025-05-20T00:10:46.123Z", "Category": "Meal", "Subcategory": "Food", "Name": "Chicken", "Calories": 331, "Protein": 38.6, "Carbs": 0, "Fat": 7.1}\n]”
},
{
“role”: “user”,
“content”: “{{38.message.text}}”
}
],
“max_tokens”: 500,
“temperature”: 0.3
}

Thank you for the observation, I took a look and it is using the right quotes but for some reason when i pasted it into the chat it turned them into a the curly ones.

The above is not valid JSON. You can verify this by copy-pasting into jsonformatter.org

Could you please try providing it again with the following instructions?

1. This forum might have or already changed your text

When pasting text into this forum, you should format the example text using the rich-text editor, otherwise the forum software might modify the displayed text, and you might get incorrect answers from others because of it.

Some things this forum software might do to mangle your text:

– remove extra spaces (which may be necessary)
– convert links to titles (when copied is incorrect)
– incorrect joined links
– convert single and double quotes to smart angled quotes (“ ”)
– emojis
– etc.

This interferes with you receiving correct answers, because it:

– makes JSON invalid (you can check by copy-pasting into jsonformatter.org)
– makes incorrect text examples when we need to build a pattern for text parsing

2. To prevent this in future, please format text in code blocks

These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

3. You might need to re-copy the original text

Once the post has been submitted, it’s too late to format it since it’s already butchered, and you need to make a re-copy of the text, and format it before submitting the forum post.

Please let us know once you have corrected the issue. This will avoid others potentially providing wrong answers based on incorrect text in your question.

Thank you!

@samliew

[
{
“json”: “[\n {"Date": "2025-05-20T00:10:46.123Z", "Category": "Meal", "Subcategory": "Food", "Name": "Grape", "Calories": 2, "Protein": 0.02, "Carbs": 0.5, "Fat": 0.02},\n {"Date": "2025-05-20T00:10:46.123Z", "Category": "Meal", "Subcategory": "Food", "Name": "Chicken", "Calories": 331, "Protein": 38.6, "Carbs": 0, "Fat": 7.1}\n]”
}
]Preformatted text

Preformatted text

[
{
“Date”: “2025-05-20T00:10:46.123Z”,
“Category”: “Meal”,
“Subcategory”: “Food”,
“Name”: “Grape”,
“Calories”: 2,
“Protein”: 0.02,
“Carbs”: 0.5,
“Fat”: 0.02
},
{
“Date”: “2025-05-20T00:10:46.123Z”,
“Category”: “Meal”,
“Subcategory”: “Food”,
“Name”: “Chicken”,
“Calories”: 331,
“Protein”: 38.6,
“Carbs”: 0,
“Fat”: 7.1
}
]Preformatted text

{
“model”: “gpt-4”,
“messages”: [
{
“role”: “system”,
“content”: “Analyze this text and determine the Category (Meal, Fluid, Snack) and Subcategory (Food, Coffee, Alcohol). Calculate Calories, Protein, Carbs, and Fat for each item. Provide ONLY the result in strict JSON array format. Do not wrap the result in any additional JSON object or string. The format must be exactly like this: [{"Date":"{{now}}","Category":"…","Subcategory":"…","Name":"…","Calories":…,"Protein":…,"Carbs":…,"Fat":…},{"Date":"{{now}}","Category":"…","Subcategory":"…","Name":"…","Calories":…,"Protein":…,"Carbs":…,"Fat":…}]. No text, no explanations, only the JSON array.”
},
{
“role”: “user”,
“content”: “{{38.message.text}}”
}
],
“max_tokens”: 300,
“temperature”: 0.7
}Preformatted text

Hi i wasnt sure if i commented within the email after pressing preformatted text that it would alter the format so i sent the emails separately. The first 2 is the json input and output and the last one is the HTTP prompt. I look forward to your answer