So, I have a notion database where each row has a column with a list of 31-41 ideas. It’s like Row 1 (some fixed text), column 1 (list of 31 ideas); Row 2(some fixed text), column 2(list of 33 ideas) and so on…
Now, I want to create an outline for each idea from this list of 31 or 41 ideas using Chatgpt. But I don’t want to feed them together and get an output for all 31 of them in one go. I want to batch-process them in a group of 5. So, for a row that has let’s say 32 ideas - they will be processed in 6 batches of 5 ideas and 1 batch of 2 ideas using chatgpt (one batch at a time, prompt will remain same).
And output for each batch should get consolidated in a new google document one after another and URL of that google doc to a new column in the respective row of notion database.
I tried many things (taking help of AI as well as google) but still not able to create and execute this scenario with success.
Yes, you got that right. To get the ideas as separate elements, I was thinking to create different sheets for a list of idea but then I guess it would complicate things.
The solution you gave worked but the issue is it stops in 3 repeats. The list has 31 items but repeater makes 3 bundles of 5 and stops. For some reason it’s not considering length as 31.
@pulkitd As described by Benjamin you need to split your text and make it an array. Right now your text is still the data type text, so the length() won’t work.
I created my own variation of this, maybe that helps you out. In this scenario I don’t use the RegEx but just split the text based on the newline between them. Also using a little bit of a different formula after the repeater (why make it simple when you can make it look hard
Make sure you split the text into items within an array. You can do this with the split() function.
Once the array is created you can use the length() function to get the length of the array.
Once you have the lenght, use this to initiate the amount of repeats you need to complete
Finally you need to grab items from your array with a formula that calculates this. Since these are items from an array, you need to use the join() again
Thanks @Bjorn.drivn It worked seamlessly. Also, how can I consolidate this data generated by Chatgpt to update back to notion? I tried array aggregator and text aggregator but seems like I’m doing something wrong as it’s not working
Yes you could do that @pulkitd . If you ask GPT to return it in a certain format, you could use this format again to split() and join() it however you like.