How to generate sequential client IDs (ROW_001, ROW_002, etc.) for each webhook response using Google Sheets as counter

Sequential Client ID Generation for Webhook Responses

Hi everyone! :waving_hand:

I’m building a workflow where I receive form data through a webhook, and I need to generate sequential client IDs for each response.

What I want to achieve:

  • Webhook receives form data
  • Generate unique sequential IDs: ROW_001, ROW_002, ROW_003, etc.
  • Store the data with the generated ID in Google Sheets
  • Each new webhook call should increment the counter automatically

Current approach:

I’m thinking of using Google Sheets to:

  1. Count existing rows to determine the next ID number
  2. Generate the formatted ID (ROW_XXX)
  3. Store the webhook data with the new ID

Questions:

  • What’s the best way to ensure the counter doesn’t skip numbers or duplicate IDs?
  • Should I use a separate “counter” sheet or count rows in the main data sheet?
  • Any potential race condition issues if multiple webhooks arrive simultaneously?

Workflow structure I’m considering:

Webhook → Count Sheets Rows → Generate ID → Save to Sheets → Respond  

Has anyone implemented something similar? Any suggestions for a robust solution?

Thanks in advance! :folded_hands:

Your ideal solution would be to use a database to handle the auto identity for you. These databases already have locking mechanisms built in to avoid duplication during concurrent calls.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.