I’m using an AI agent to retrieve a member list form google sheets and create a sheet for each member using {{ $fromAI(“username”) }}
Even though the ai agent is cycling through and creating the sheets 1 by 1 with the correct variable.
Google sheets just creates the same sheet over and over.
Lead’s me to believe ai agent cannot clear and re-use the same variable. Is this correct? Is there a workaround?
In your last screenshot you’re sharing the username of Run1 of 6.
Is it the same for all 6 ? Could you share your workflow so that we can recreate this issue?
Thanks
Tip for sharing your workflow in the forum
Pasting your n8n workflow
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!
Each of the 6 usernames is different, thus the question
Can I run $fromA(“username”) but have the variable cleared/reset/replaced for each iteration.
The ai agent get’s the list of usernames, then attempts to create sheets for each of the 6 users. But it seems it can’t clear/overwrite the variable so it will only ever create the first username sheet.
I solved this, but creating a loop, but it’s annoying.
I solved this a second way by creating a lot of google sheet tools and variables so that I could have:
sheet tool1 handle $fromAI(“username1”)
sheet tool2 handle $fromAI(“username2”)
etc.
Also, annoying and limited by how many tools/variables I provide for it