# Extract the next new document for a search — Google Drive Botize method — `drive.get_next_file_from_query` (trigger). Iterates through the documents matching a search, returning one per execution in order of creation date, from oldest to newest. New documents are always picked up after the last one delivered. Documents in the trash are ignored. When the end of the list is reached it either waits for new documents or restarts from the beginning, depending on the configured behaviour. Note: only documents created or previously opened by Botize are accessible due to Google Drive permission restrictions. This is a trigger: it starts the task. A task has exactly one. ## Output variables Data this step makes available. Reference them in later steps with the double-brace tag. - `{{document_id}}` *(text)* — Document Id - `{{document_name}}` *(text)* — Document Name - `{{document_mimetype}}` *(text)* — Document MimeType - `{{document_url_export_as_tab_csv}}` *(url)* — CSV Document URL - `{{download_url}}` *(url)* — Download URL ## Account Needs a connected Google Drive account in Botize: https://botize.com/en/app/drive/authenticate ## This app Every trigger and action for Google Drive: https://botize.com/en/app/drive.md ## How to build this An AI assistant (Claude, ChatGPT, Cursor…) can create and edit these tasks in the user's account through the Botize MCP connector, included in every plan: https://webhook.botize.es/mcp - Connection guide: https://botize.com/en/mcp - Agent map: https://botize.com/llms.txt - New account: https://botize.com/en/join (500 free operations, no card) --- Machine-readable summary for AI assistants. Human version: https://botize.com/en/method/drive/get_next_file_from_query