Inventory sheet filler

Connect the sheet writer

One-time setup by the owner of the master spreadsheet and the Shopify app.

  1. In the inventory master, open Extensions → Apps Script. Update the existing InventoryAutofill file with the updated script. Keep the other script files. Under Services, enable Google Sheets API. Run setupQueue once.
  2. Generate a long random secret. Under Apps Script Project Settings → Script properties, save it as CF_SHEET_SECRET. Use that same secret in Cloudflare Pages under the ConsignFlow production environment’s Secrets. Keep it out of sheet cells and browser code.
  3. Deploy the Apps Script as a web app executing as the sheet owner, accessible to the server (Anyone). Every write must carry a valid, time-limited signature. Set the deployment’s /exec URL as CF_SHEET_WEBAPP_URL in Cloudflare Pages, then redeploy ConsignFlow.
  4. In the existing Shopify app project, generate an admin link extension with Shopify CLI. Use the Products extension configuration while keeping the generated UID. For an embedded app using ConsignFlow as its application URL, use the relative target /sheet-picker.html. Deploy and release the Shopify app version. In Shopify Admin, open Products → More actions → Fill inventory sheet.
  5. Test one active SKU that has one otherwise blank, preformatted row in Active. The writer checks the actual sheet again, fills the saved layout, and records the SKU in the queue. Keep the completed queue entries so later edits stay intact. Use separate rows while an import is running.