4

I would like to know how to reference in a hidden value the first and last name of a mobile worker in CommCare.

I researched and I was able only to reference the username and location name, but can't find the exact one for first and last name.

1 Answer 1

5

In order to do this you need to use something called Custom User Data. In the calculate condition of your hidden variable you can use an expression like this:

instance('commcaresession')/session/user/data/commcare_first_name

And for the last name you can use:

instance('commcaresession')/session/user/data/commcare_last_name

The documentation will show you other examples of how to access things like the user's phone number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.