dusk bot
integrationssort a range

dusk botintegrationsgoogle sheets

sort a google sheets range without splitting records

put dispatch in due-date order, with every customer still beside their own job. the bot can sort a google sheets range by several columns.

by the dusk bot team · checked · how we made this

later rules break ties, such as customer name after due date. include the full width of each record, with headers and totals outside. ask it to show the range and wait before reordering.

pixel art: a purple cat bot and a green pixel bot beside the Google Sheets mark on a white tile, a chart on an easel and a signpost, on a lemon field in front of white cliffs with a waterfall, one saying "due dates in order"

what it does

a date must travel with its customer and quantity. sorting one column can separate values that belong together. give the bot the sheet link, tab and full record width.

keep headers and totals outside the range. name the last row or ask the bot to find where records end.

put rules in order: due date first, customer second. the second rule only breaks ties in the first.

when you would use it

  • put dispatch in order. sort by due date, then customer for matching dates.
  • find attendees faster. alphabetise complete records while leaving the header above.
  • group the job list. sort by stage, then scheduled date within each stage.

try it

paste this into a chat with your bot

every thursday at 16:30, inspect the dispatch tab in the ottervale joinery spreadsheet. find all current job records and include every record column. exclude the header and totals. propose sorting by due date ascending, then customer ascending. show the exact range and both rules here. ask me before you change anything and wait for agreement. sort only that range, then confirm completion here. never sort one record column on its own.
when
thursdays at 16:30
needs
google sheets read and write for inspecting and sorting the agreed range

what comes back looks like this (an example)

ottervale dispatch sort proposal
records: dispatch a2:f24
first: due date, earliest first
then: customer, a to z
header and totals excluded. waiting before reordering.

set it up

  1. limit the access. connect sheets with read and write for inspection and sorting.
  2. describe the table. include its link, tab, full record width and where records end.
  3. choose rule priority. name directions and tie-breakers. require a range preview and your agreement.
  4. follow a familiar customer. their date and quantity should travel with them. pause the routine if the layout changes.

what it needs from you

inputrequiredwhat it is
rangeyesThe range to sort.
sortSpecsyesThe sort order per column.
spreadsheet_idyesThe ID of the spreadsheet.
responseRangesnoLimits the ranges included in the response spreadsheet.
responseIncludeGridDatanoTrue if grid data should be returned.
includeSpreadsheetInResponsenoDetermines if the updated spreadsheet resource appears in the response.

from composio's catalog for Google Sheets (action GOOGLESHEETS_SORT_RANGE, read 12 november 20264). your bot fills these in from what you tell it.

how dusk bot handles it

dusk bot counts Sort Range as a change: it alters something in Google Sheets, and the sending setting does not cover it. a bot you allow only to read can never call it.

the permissions Google Sheets asks for to run it: spreadsheets, drive.file, drive.

where it stops

  • everything in the range moves. include full rows of record data and leave headers and totals out.
  • rule order changes the answer. customer first gives a different queue from due date first.
  • follow the data after sorting. open a familiar customer’s row and confirm its date still belongs to it.

what it looks like

an invented dispatch example

before

otto sorts only the due-date column. the dates no longer sit beside their own customers.

after the bot

the proposed range covers dispatch a2:f24, with the header and totals outside. each complete record moves together.

an illustration with made-up names and numbers.

try it in 2 minutes

  1. paste the sheet link
  2. ask for the full record range without headers or totals
  3. name the first sort rule and tie-breaker
  4. review that plan before sorting

quick checklist

  • full record width included
  • header and totals excluded
  • sort directions and priority clear
  • review required before reordering

mistakes people make

sorting only the date column

include the customer, quantity and every other record column.

letting the header join the sort

preview the first and last rows before allowing the change.

questions

can it sort by two columns?

yes. put the rules in priority order. the second breaks ties where the first column has matching values.

will sorting wait for me to approve it?

only if you tell the bot to wait. the sending setting does not pause this edit. include an ask-before-changing instruction.

sources

  1. dusk bot docs: files and apps
  2. dusk bot docs: routines
  3. dusk bot docs: computer permissions
  4. composio, Google Sheets toolkit (catalog version 20261101_00), checked 12 november 2026

drafted with ai help from the dusk bot docs and the sources listed on this page, then checked against them. if something here is wrong or out of date, write to [email protected].