adding autoincrementing respondent counter to survey | XM Community
Skip to main content
Question

adding autoincrementing respondent counter to survey

  • December 2, 2025
  • 1 reply
  • 25 views

Forum|alt.badge.img

This seems trivial but can’t figure it out. I would like to include a simple “respondent counter” variable in a survey, with the counter autoincrementing with each (completed) response. That is, the data table of responses should contain a simple integer field showing “1” for the first repondent, “2” for the second and so on.

I’ve looked into various possible solutions, such as:

  • setting embedded data in the survey flow (no counter options)
  • post-survey options (no counter options)
  • quota functionality (“quota count” comes close, but is a single auto-updated number, not a field within each survey response)

Importantly, I need this counter variable already present in the survey reponse/data table in order to add it to a contact list (and have it available for downstream surveys). So offline creation of the counter (e.g., based on response datetime) is not an option. Any suggestions welcome.

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • December 2, 2025

I think the best way is to use a survey flow web service call to keep and update an external count and return the counter as an embedded data field.

Another approach would be to use a quota and the piped quota count to calculate the counter (e.g., counter = $e{ qo://QO_xxx/QuotaCount + 1 }). However, with this approach you might end up with some duplicate and missing counts due to simultaneous responses (e.g., 1, 2, 3, 3, 5, 6, etc.).