CONCAT (String and numbers)

Hello, I would like to build a unique code using concatenation of previous questions, example:
1-State: MT
2-Project name: SIPA
3- Identity number: 56589785584
4- Name of person: Maria do Carmo Silva
3- Date of birth: 05/12/1980

Code formation: STATE + PROJECT NAME + last 3 digits of ID number + first letter of person’s first and last name + last 2 digits of year of birth = MTSIPA584MS80

Can you help me?

To get trailing digits you can use

The 2-last-digit year you can get with format-date( …, %y ), see ODK XForms Specification.

Hint:

2 Likes

Create a calculate variable and use concat() function to stitch all the codes together to get required ID. Use delimiter of your choice in between.

1 Like

@wroos, @jbindrookobo, :bowing_man:

@barata_clicia1, here are some workarounds on how you use the mod function, substr function and the format-date function. These workarounds discussed previously in the community should help you understand how they are used.