williamzisa
williamzisa2d ago

Passing variables error

Hi everyone, sorry but I have a problem on my first workflow, passing variables between nodes (I'm not a developer :D) I have set a simple "Get row" from Supabase, which returns me an array + objects with variables. Then I want to give three of them (question, answer, keywords) to OpenAI assistant and return me a "script" variable. But: - the assistant doesn't give them as input and ChatGPT gives me a generic script like "please give me the 3 variables to do it" - or there is an error about undefined properties How I can do it? Setting the "Output" of the get rows or putting "Get Rows.properties.question" for example?
No description
No description
4 Replies
AI Support
AI Support2d ago
AI Support Bot Information
<@947270381897662534> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
AI Support
AI Support2d ago
AI Response
It sounds like you are having trouble passing data from one node to another in your workflow, particularly from the "Get row" node to the OpenAI assistant. Here's a step-by-step suggestion that might help you resolve this issue: 1. Ensure you're properly accessing the properties of the object: - When you retrieve data from Supabase, it typically returns an array of objects. You need to ensure that you're correctly accessing the specific object and fields from this array. - For example, if your data is stored in a variable named getRows, and you want to access the question property of the first item in this array, you should use something like getRows[0].question. 2. Ensure variables are correctly passed: - When configuring the input for the OpenAI assistant node, make sure you're using the correct syntax for accessing each variable. If you need to pass multiple variables, you'll usually configure them as inputs in the assistant node. 3. Error handling: - If you're encountering errors about "undefined properties," make sure your data retrieval is correct and verify that the data actually contains the properties you are trying to access. 4. Testing & Debugging: - Use logging or debugging tools within your development environment to output and verify the data structures you are working with. This will help you ensure you are accessing the correct elements or properties.
5. Referencing the FAQ: - You might want to refer to solutions related to similar issues, such as ensuring appropriate keys and values are used when retrieving data. For instance, when users encounter similar errors, like "Property 'product_name' does not exist on type 'unknown'" it's often a matter of checking if the correct properties are being accessed. For further assistance, consider watching tutorials or reading up on how to pass data between nodes effectively. If these steps don't resolve your issue, you might need more specific support regarding your setup and configuration.
BuildShip AI Support
williamzisa
williamzisa2d ago
Thank you! Using "getRows[0].question" it works fine! But how I can do it with multiple objects? I need to set up a Loop? How? 🙂 I have tried to set up a Loop but using [0] it copies me the same output in every rows involved...
No description
Gaurav Chadha
Gaurav Chadha13h ago
Hi @williamzisa, yes you'll require to setup loop. Here's an example supabase loop workflow you can use https://buildship.app/remix/2b97431d-088e-4421-b582-610c537f6141. It takes all the rows from supbase table send it to loop and return the array of items.
BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.