Log every day's Sprinklr social care cases to a Google Sheet

By General Input

Every night at 11pm, every case your social care team opened or touched that day lands in a spreadsheet, ready to pivot and chart.

Integrations

  • Sprinklr
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations
  • Customer Support

Every night at 11pm, export the day's Sprinklr social care activity into a Google Sheet so we keep a durable history for reporting. This is a straight structured export: no summarizing, scoring, or judgement, just one row per case with a fixed set of columns.

Use the Sprinklr Search Cases operation to pull every case created or updated in the last 24 hours. Anchor the window to the scheduled run time so consecutive nights line up cleanly and cases at the boundary are neither dropped nor counted twice.

Page through the full result set rather than stopping at the first page, so busy days are never truncated. The legacy case search endpoint paginates through the JSON request body rather than through query parameters: include start and rows (or pageNum and pageSize) inside the body, then keep requesting the next page until a page returns fewer rows than requested or the running count reaches the reported total.

Sprinklr's default limits are 1,000 requests per hour and 10 requests per second, so request cases in reasonable batches, on the order of 100 per page, rather than one row at a time. If a call comes back with 429, or with 403 and the message Developer Over Rate, back off exponentially (1s, 2s, 4s, capped) and retry the read.

Append the results to a Google Sheets tab using the Append Values operation, writing one row per case in this exact column order every night: case number, status, priority, queue, assigned agent, channel, created time, last updated time. Keep that order fixed so the sheet stays easy to pivot and chart. Write both timestamps in ISO 8601 in a single consistent timezone, and write an empty value for any field a case does not have rather than shifting the remaining columns left.

If the tab is empty on the first run, write the header row before the first batch of data. Group the rows into as few append calls as the row count allows instead of appending one row at a time. If no cases were created or updated in the window, finish cleanly without appending anything and without treating the empty day as a failure.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads