Looping and referencing data from previous step

Hi All,

Total noob here...

I have a fairly simple workflow idea i'm trying to build:

  1. take rows from retool db
  2. loop the records trough and trigger a separate AI action for each, also reference the row's data in the AI action input/prompt
  3. take each answer and save it to another table

Any tips&tricks to get this actually working?

Many thanks in advance!!

Simple POC follows. The trick is referencing the data correctly in the loop (value.foo) and convincing ChatGPT to give you a simple output which you can further parse once the loop is done (I ended up with an array of arrays, which I could then further parse into a database record):

POC: For each database record consisting of a key and a date, get the name of a famous person born on that date in a previous year.

Is that something like what you are trying to do?

Hi jg80,

Awesome, thanks for your help. i got it working. The thing which threw me off was that on hover the {{value.something}} gave "not defined", but it still seems to work. I should have know to check the JSON-tab.


Yes - the incorrect linting is an annoying "feature" but glad you got it working. Happy building!