Turn your pantry sheet into a ready-to-buy Instacart cart

By General Input

Every Thursday we check your pantry sheet, find what is running low, and post a one-click Instacart cart to Slack so nobody retypes a shopping list.

Integrations

  • Instacart
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Operations

Every Thursday at 9am, check our office pantry inventory in Google Sheets and hand our office manager a ready-to-buy Instacart cart for everything that is running low. Use a cron trigger.

Start by reading the Pantry Inventory tab with the Google Sheets Get Values operation. Each row holds an item name, a UPC barcode, the unit we buy it in, the current count on hand, and the par level we want to keep in stock. Treat the first row as headers and resolve columns by header name rather than fixed positions, so the sheet can be reordered without breaking the run.

Keep only the rows where the current count is below the par level, and compute the reorder quantity as par level minus current count. Skip rows missing an item name or with non-numeric counts. If no rows are below par, end the run immediately without posting to Slack and without writing to the sheet, so the channel stays quiet on well-stocked weeks.

Build the cart with the Instacart Create Shopping List Page operation, turning each short row into one line item. Reference the product by upcs when the row has a UPC and by name when it does not. Note that upcs and product_ids are mutually exclusive on a single line item, and UPCs take priority for product matching. Put the reorder quantity and unit into line_item_measurements, which is the shopping-list field, not measurements, which is recipe-only. Stick to each, lb, and oz for pantry goods and map anything unrecognized to each.

Instacart returns a 400 when the same identifier appears on more than one line item, so dedupe rows before building the payload: group by UPC when present and by lowercased item name when not, summing the reorder quantities of merged rows. Expose a max items cap as a configurable knob defaulting to 50, and take the largest shortfalls first when the list exceeds it.

Post the result to Slack with the Send a Message operation in our office ops channel. Include how many items are short, an itemized list with each item name plus its reorder quantity and unit, and the one-click Instacart link from products_link_url so the office manager picks a store and checks out without retyping anything. Format the message with Slack mrkdwn.

Finally, use the Google Sheets Update Values operation to stamp the run date and the generated Instacart link back onto the sheet, so we have a record of what was reordered and when. Keep in mind the generated link expires after 30 days by default.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet 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 boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats