How to run a scenario on all the records in a Google Sheets and add a condition IF Sheet doesn't contain the value of a variable?

Hi, I’m trying to understand how to make the scenario keep running on multiple records if a condition is true and make it run on all the records in a sheet.

Basically, I am testing an integration from Odoo where once I get a new task completed, I post it on linkedin and It’s not repeating anymore. Now i’m testing it with just google sheets.

It should work like this:

  • I get a Odoo task once is completed
  • I ask ChatGPT to make a little post about it
  • I publish on Linkedin

But I don’t want duplicates, so If the task with that ID had been already processed, it doesn’t have to reprocess that task.

This is my scenario with Sheet for testing

  • Get a sheet from my Drive and then I added a router.

  • Then I search in a google sheet called Tasks

  • I iter on that google sheet all data and then I create 2 variables: value in A column and row number (used later to delete that row from the first google sheet)


  • In the second route I call the variables, but the first problem is that once I run the scenario, It stops at first variable, instead (in this case) running on all 3 results. So If I press Run once, I get all 3 records in the first route, and on the second just one:

  • The second problem is that I have 2 sheets in this case: Tasks from Odoo and Processed Tasks. Once it runs, it should add a row with the value from Tasks from Odoo to the Processed Tasks, and then delete the Row from “Tasks from Odoo”, so it doesn’t process that record anymore.

I have tried to add a filter where I say " If value from Odoo is not contained in the Processed tasks sheet, then skip it

But the problem here is that it stops cause It’s working just on a row and not on all 3, and I cannot test it to understand if it’s working or not.

Maybe there’s another better way to do it, but in the meantime I also practice on Make.

Thank you

1 Like

Hi @Ionut_Tudorache

So I believe this google sheet scenario is the second workflow of your automation and the job is to just delete the task from “task” sheet and to add in “processed task” sheet.

Is that right???

Your workflow doesn’t seem doing the job.

You can follow the steps to improve it:

  1. Remove “Get a sheet” module and start from “search rows” module. Search in “tasks” sheet.
  2. Use “add a row” module to add the task from “tasks” sheet to “processed tasks” sheet.
  3. Use “delete a row” module to delete the row from “tasks” sheet.
    This is it.

You won’t need any iterator or set variable here. (Apart from this, you can use “set multiple variables” and “get multiple variables” modules to avoid using multiple modules and save operations)

Now, You can do one thing if you have one workflow.

Watch completed task in Odoo > Ask GPT to create post > Post on Linkedin > search same task in google sheet “tasks” > create the task in “processed sheet” > "delete the task from “tasks” sheet.

Regards,

Msquare Automation - Platinum Partner of Make
@Msquare_Automation

Hi @Msquare_Automation

Thanks for fast answer.

Well, everything works fine for Odoo if I follow what you said, but if the module runs for example once per hour, it will get all the “completed” tasks from odoo and make a post from them.

I think that If I do it in this way, I get a lot of duplicates.

This is why I wanted to use like an external app (Sheet) where I can just paste the ID everytime a post from Odoo task has been done. In this sheet I would like to use the ID of the Odoo Task, so I can create a variable from it and use it as a filter, Where I add this condition that Skip the post if the Odoo task ID is contained in that Sheet.

I think it should work this way, so this is why I am testing it just with Googlesheet, like in the screen above, cause I really want to understand the logic if is correct.

So I can try to improve it as you suggested, but how can I use a conditional logic If I don’t have a variable that I can use in the second route?

1 Like

@Ionut_Tudorache

So is it listing the completed tasks in Odoo and you want to avoid the tasks from Odoo that are processed already and keep the record in sheet to search.

Then you can start from sheet “search rows” in “processsed tasks” > Aggregate all the rows using aggregator > list tasks in Odoo > set filter then, {{map(ARRAY_FROM_AGGREGATOR;COLUMN_THAT_CONTAINS_ODOO_TASK_ID)}} does not contain (from array operators) odoo ID > Now create post using GPT > Post on LinkedIn > Add task in “processed tasks” sheet.

This way, you won’t need “tasks” sheet and will do the things in one workflow.

if you still have questions or it doesn’t give you the right solution, please feel free to share a loom recording explaining the flow you have and your goal.

Regards,

Msquare Automation - Platinum Partner of Make
@Msquare_Automation

Well, I’m gonna try soon and let you know! Really thank you :slight_smile:

1 Like