Is there a way to set an embedded data field that will assign a sequential ID number? | XM Community
Skip to main content

Hello community members,
This seems like such a basic operation that I'm surprised I could not find a solution in the Support pages or the Community.
I'm building a project request intake form. The client would like to have a unique Project ID number assigned for each submitted project, and would prefer it to be sequential. It could be as simple as assigning 1 to the first submitted project, 2 for the next, 3 for the third, etc. However, recognizing that there will be incomplete responses that are started but never submitted, the client might accept gaps in the project ID numbering scheme, as long as they are still in a relative order (that is, the highest number always represents the most recently submitted project, and each successive lower number is the one previously submitted).
I know that you can set a random number as Embedded Data in the Survey Flow, but I can't find any way to set consecutive, increasing numbers for each response. I'm probably overlooking something obvious. Is there some way to assign an increasingly larger number to each response as it is submitted that appears in the dataset?

It's not possible without using an external tracker. At the start of the survey, call an external webservice providing the response id. If the response id exists return the row number, if not add it to the bottom and return the new row number.
However, it gets super complicated pretty fast due to concurrency.


Thank you for answering. Given the complexity this is probably not a viable solution for a project of this nature. I'll have to see if the client will accept an alternative or can live without this requirement.


Leave a Reply