TASK_SPLIT is a custom function that intelligently splits a text file into logical sections using AI. It analyzes your document, identifies natural division points based on your instructions, and creates separate Google Docs for each section. Each section is then accessible via automatically created hyperlinks in your spreadsheet.
=TASK_SPLIT(header, file_link_cell, prompt, model, [celladdress])
Parameter | Data Type | Required | Description |
---|---|---|---|
header | string | Yes | Column header for the task template |
file_link_cell | string | Yes | Cell containing a link to the text file to split (e.g., "A1") |
prompt | string | Yes | Instructions describing how to split the file into sections |
model | string | Yes | The model name in the format 'provider/model_name' (e.g., "Gemini/gemini-1.5-pro") |
celladdress | string | No | The cell address to place the first section link (if omitted, places in cell to the right of the function) |
The model
parameter allows you to select any AI model available in your Sheet Workflows configuration. For best results with complex document structures, use more powerful models like:
The prompt
parameter is crucial for getting good results. Be specific about:
The optional celladdress
parameter lets you control where section links appear:
=TASK_SPLIT("Split Report", "A1", "Split this document into chapters. Each chapter starts with 'Chapter X' and should be a separate section.", "Anthropic/claude-3-sonnet", "C1")
=TASK_SPLIT("API Documentation Sections", "B5", "Split this documentation by level 2 headings (## in markdown). Each section should include its heading.", "Gemini/gemini-1.5-pro")
=TASK_SPLIT("Meeting Topics", "D3", "Identify and extract discussions about: 1) Project Timeline, 2) Budget Concerns, 3) Technical Challenges, and 4) Next Steps. Create a section for each topic.", "OpenAI/gpt-4o", "E3")
prompt
parameter for better splitting accuracyfile_link_cell
is properly accessible before runningCause: The cell referenced by file_link_cell
doesn't contain a valid file link, or the file is inaccessible.
Solution: Verify the file link is correct and that you have access permissions to the file.
Cause: The language model encountered an error processing your document.
Solution: Try a more powerful model or reduce the file size. Also check that your instructions are clear.
Cause: The language model couldn't properly format its response for section identification.
Solution: Simplify your splitting instructions or try a different model.
Cause: Required parameters like file_link_cell
or prompt
are missing.
Solution: Ensure all required parameters are provided in your formula.
Cause: The celladdress
parameter contains an invalid cell reference.
Solution: Use a valid A1 notation cell reference like "C1" or column letter like "C".
Cause: TASK_SPLIT only creates instructions; it doesn't execute until run.
Solution: Select the cell containing the TASK_SPLIT formula and click the "Run" button in the Sheet Workflows sidebar.
TASK_SPLIT can handle documents up to several megabytes in size, but performance and accuracy depend on the model used. For very large documents, consider pre-splitting into smaller files.
TASK_SPLIT works with plain text files, markdown documents, and Google Docs via their file links. It's designed primarily for text-based content.
The sections are saved as individual Google Docs in your Google Drive, typically in a folder named "sheetworkflows/docs/". Each document will have the section name as its title.
Yes, through your prompt instructions. For example: "Split by chapters and name each section 'Chapter X: [chapter title]'".
Yes, you can instruct the AI to split the document wherever certain keywords or phrases appear by specifying this in your prompt.
No, there's no preview functionality. However, you can test your splitting instructions on a smaller portion of your document first.
The accuracy depends on the clarity of your instructions, the document structure, and the capability of the selected language model. More powerful models and clear section boundaries yield better results.
Yes, you can split code files into logical sections, though you should specify in your prompt how to handle code blocks appropriately.
If the AI can't confidently identify sections based on your instructions, it will make its best attempt based on content organization. Check the results to ensure they meet your needs.
Yes, each section is saved as a Google Doc with a link in your spreadsheet, which can be used with other functions like TASK_MARKDOWN_TO_DOC or TASK_DOC_TO_MARKDOWN.
1 week ago