Hi everyone,
I’m hitting a wall with a no-code automation and would really appreciate some help. I’m trying to build a workflow that extracts only the latest creative writing task and response from a Google Doc and sends it to an AI agent.
DAILY CREATIVITY TASKS - Evaluation.blueprint.json (92.4 KB)
The Setup:
-
Source: A Google Doc that contains multiple creative writing tasks and my responses.
-
Structure: Each task/response block follows a specific format:
Title: ... Task: ... <The task description> ENDTASK <My response to the task> ENDRESPONSEThere are many of these blocks, one after another, and I append a new one to the end of the document each day.
-
Goal: My objective is to create a workflow that only extracts the very last Task and Response pair (the one at the end of the document) and sends only that content to an AI summarizer. I do not want to process the entire document.
My Scenario/Workflow:
-
Google Docs - Get Content of a Document: This retrieves the full document content and stores it in a variable called
TextContent. -
Tools - Set variable: In this module, I am trying to use a formula to parse the
TextContentand isolate just the last block. -
OpenAI - Create a Completion: This is the final step where I want to send only the extracted text.
The Problem:
No matter what formulas I try, the workflow seems to be processing the entire document. The AI module is consistently receiving all the text from the Google Doc, not just the last block I’m trying to isolate.
Here are some of the things I’ve tried:
-
Using
lastIndexOfandsubstring:trim(substring([1.Text Content]; add(lastIndexOf([1.Text Content]; "ENDTASK"); 7)))The logic here was to find the start of the last block and get everything to the end of the document.
-
Using nested
splitfunctions:trim( last( split( last( split(TextContent; "ENDTASK") ); "ENDRESPONSE" ) ) )This was an attempt to split the document by the task marker, grab the last piece, and then split that piece by the response marker.
Despite these attempts, the output of my Set variable module seems to be the full document, and it’s the Entire content of the document is being passed to the OpenAI module.
My main questions for the community are:
-
Is there a single, reliable Make.com formula that can extract the text between the last
ENDTASKand the lastENDRESPONSEmarkers? -
Alternatively, can I simply get everything in the document after the very last
ENDTASK? -
Is there a common pitfall with passing text from a
Set variablemodule that might be causing the entire document to be sent instead of the parsed variable?
I’m a non-coder, so a simple, easy-to-implement solution would be fantastic. The goal is to get this working without a complex multi-step parsing process if possible.
I seeked help from CHatGPT, Claude and GEMINI with no success… now I hope that some sharp human brains will do the trick!
Thanks in advance for any help or guidance you can offer! I also attach the blueprint.