I think I'm stuck in an iterator but I don't know how to fix it

I have a scenario where:

  1. I get some files from google drive, these files have a column with an ID
  2. I then get some files files from another folder in google drive, which has some people and their ID, which matches the ID’s in step 1
  3. If the two ID’s match, I want to grab the name of the person, and then create a google sheets spreadsheet and put in all the rows from step 1 that has the same ID as the person, and do this for each person
  4. But I first check google drive if I already have a file named the person’s name, if not, I create the new spreadsheet with the person’s name as the title
  5. Then I need to put in all the rows that match with the person’s ID

Sounds very complicated I know… But I’m very close, I’m just stuck in an iterator so it keeps creating a new spreadsheet with the same person’s name, because it still hasn’t finished the first iterator that goes through the names, and I don’t know how I’m supposed to change it

blueprint (11).json (218.4 KB)

Hi @Younes_Elhamss, Firstly, it would be really nice if you renamed your modules. For yourself, for us, and for your future collaborators. Second, what does your ‘Set variable’ do ?

  1. Assuming in ‘iterate14’ module your output is ordered by person’s name - you need a get variable-set variable module couple to get ‘last person’ (n-1) and compare it to current array element. If it’s a new element, set a new variable and continue with creating spreadsheet. This will resolve problem of creating multiple spreadsheets.
  2. Assuming you need to ‘Add rows’ in the new spreadsheet, you’ll also need to add a router just after ‘get variable’ module.

s

here’s the json (empty modules, need to configure) to get a better look at it :
newspreadsheet and existing personnel.json (11.4 KB)