Hi MindStudio Community,
We’re encountering a persistent issue when trying to populate Google Sheets or Google Docs using data generated by a “Run Function” block (using JavaScript).
Workflow Goal:
The goal is to fetch data, process it using AI and custom functions, format the results into an array-of-arrays structure suitable for Google Sheets, and then either create a new Google Sheet or update an existing one with this array data.
The Problem:
- Function Block Success: Our “Run Function” block executes successfully. Using
console.log
, we have verified that it correctly processes inputs (fromai.vars
) and returns the data in the expected format (either a direct array-of-arrays[[...],[...]]
or an object containing the array like{ sheetData: [[...],[...]] }
). - Integration Block Input Failure: We then try to use this output variable in the
Data
/Content
/Values
field of either a “Create Google Sheet”, “Update Google Sheet”, or “Create Google Document” block. We have tried both:- Referencing the direct output:
{{functionBlockName}}
(when the function returns the array directly). - Using the
get
helper:{{get functionBlockName "$.sheetData"}}
(when the function returns{ sheetData: [...] }
).
- Referencing the direct output:
- Observed Behavior: In all these cases, the logs for the Google Sheet/Doc block show that the
Content
input resolves to an empty string (Content: ""
). Consequently, the sheet/doc is created empty, or the update/doc creation fails because no data is provided. - Working Cases: We’ve confirmed that:
- These Google integration blocks do work correctly if we provide static data directly in the
Content
field (e.g.,[["A", "B"], ["C", "D"]]
). - The “Update Google Sheet” block can successfully use variables set by other block types (like a simple string from an AI block) to update a single cell’s content.
- These Google integration blocks do work correctly if we provide static data directly in the
Conclusion:
The issue seems specific to passing complex data structures (arrays/objects containing arrays) generated as output from a “Run Function” block into the main Data
/Content
field of the Google integration blocks. The variable seems to resolve as empty within the context of that specific input field.
Question:
Is this a known limitation? Is there a different syntax or method required to correctly pass an array-of-arrays generated by a “Run Function” block into the “Create/Update Google Sheet” or “Create Google Document” blocks?