Concat specific digits of strings

Dears,
I want to generate a unique ID for each submission, using concat command.
But is there any way to concat specific digits from previous responses?

for example: the ID should be
[ the first 2 digits from the HH name + the last 5 digits from the national id + the time from the start(meta-data) command + the last 3 digits from uuid]

ODK supports a number of different string functions that you can use to extract specific portions of any response string. You should be able to use these (in combination) to accomplish your needs. Specifically: substr(), substring-before(), substring-after() and string-length().

Once you have the pieces you need, you can combine them using concat(), with whatever separators you desire.

2 Likes

Great, that will be useful. I will play around these functions to get what I want :grin:
Thanks

YW. Have a play with the available string functions listed, and post back if you get stuck. But from what I can deduce from your example the existing functions should suffice.

1 Like