Openai auto control from google sheet

Hello All,

I have a question related to a scenario I want to create.

First of all let me give you a bit of context. I want to generate a weekly post with chatgpt but I want to be sure that every new post wills be different from the previous ones. Typically I have 100 topics which are all differents but they are related to a main topic.

So every monday I generate a post from one line from a google shit, as soon I read this first line I ask to one instance of chatgpt to generate a title with APIkey “#1” then this specific title is sent to the same instance of chatgpt APIkey “#1” asking him to generate a post.

Until so far all is working but as soon I add autocontrol asking to chatgpt to check the previous titltes before creating a new title and asking him the previous post before creating new post my scenario is entering in a infinite loop…

Mmany thanks in advance

1 Like

Hi there!

Not sure if this works but please try this below:

Set variable as the trigger, you can just change this based on your preference, or you can just use the router as the start of the Scenario. Just be sure to arrange the “sequencing” of the modules.

Route A - Title Creation

Get a Cell module > Search rows module - get the content of that cell then check if that title already exists or not. In the Search module’s filter be sure to enter the filtering parameters. Example "Title (A) > equal to > “”.

Then as you can see in the screenshot, there is a filter that says “Title doesn’t exist”, the filter for that is “Total Number of Bundles” (mapped from the Search rows module) Equal to “0”, this means that this title doesn’t exist yet so create title when synced to the chatGPT module.

Then update a cell to make sure that this newly created article says that this is already used in this run.

Then last module for this route will be Set Variable module as this will be used in the next routes using the “Get Variable” module. Set the variable name to let’s say “Title”.

Route B - Title Creation

The logic is similar to route A, this time you’ll just need to add a Get Variable a the start of this route and then enter the variable name “Title” from the previous Set Variable module.

Also, the Search module’s filter will be to search for that article’s content if it’s already used or not. Then in the filter (please excuse my typo on that part, it should still be “EQUAL TO” operator" as we need to make sure that it’s not existing) then create an article via ChatGPT module, map the value from the Get Variable module.

Then last module for this route will be Set Variable module as this will be used in the next routes using the “Get multiple Variables” module. Set the variable name to let’s say “Content”.

Now the last route is getting the Title and Content then generate an article about the created Title and content.

In the Get Multiple Variables module, enter “Title” as variable 1 then “Content” as variable 2.

Please note that this might need some trial and error, if you also noticed why I suggested to do different routes is to prevent multiple loops as this sometimes happen due to the previous module’s number of bundles (output) which will cause a lot of wasted operations. I hope this helps!

1 Like