Question depends on user

Hi

Is it possible to show question based on the user name.

For example,

I have one id question along with 10 other questions and 5 users in one
application.

I want user 1 to see ( except id ) first two question, user 2 to see
question 3 and 4 , user 3 to see question 5 , 6, , user 4 to see 7 and
8, and user 5 to see last two questions.

How this can be done

Thanks and Regards

··· -- Manoj

Hi Manoj,
In 'users' you can set 'Custom Registration Data'. You could use this to
set a value which determines whether or not a question shows.

··· On Friday, June 13, 2014 2:14:05 PM UTC+6:30, Manoj Soni wrote: > > Hi > > Is it possible to show question based on the user name. > > For example, > > I have one id question along with 10 other questions and 5 users in one > application. > > I want user 1 to see ( except id ) first two question, user 2 to see > question 3 and 4 , user 3 to see question 5 , 6, , user 4 to see 7 and > 8, and user 5 to see last two questions. > > How this can be done > > Thanks and Regards > -- > Manoj >

Hi Manoj

As mentioned you can use custom user data as described on this wiki page:
https://confluence.dimagi.com/display/commcarepublic/Custom+Registration+Data

In addition to that if you just want to distinguish between individual
users you can access their username in a similar fashion by using the
following XPath expression:

instance('commcaresession')/session/user/username

The custom registration data is probably a better approach since then if
you add users you don't have to edit your application to include their
usernames, you can just set the appropriate user data for the new users. It
also allows you to have the same logic work for multiple users without
having to specify all of their usernames in the app.

Out of curiosity could you give more info about your use case and why you
need to hide some questions from some users?

Best regards
Simon

··· On 13 June 2014 10:12, wrote:

Hi Manoj,
In 'users' you can set 'Custom Registration Data'. You could use this to
set a value which determines whether or not a question shows.

On Friday, June 13, 2014 2:14:05 PM UTC+6:30, Manoj Soni wrote:

Hi

Is it possible to show question based on the user name.

For example,

I have one id question along with 10 other questions and 5 users in one
application.

I want user 1 to see ( except id ) first two question, user 2 to see
question 3 and 4 , user 3 to see question 5 , 6, , user 4 to see 7 and
8, and user 5 to see last two questions.

How this can be done

Thanks and Regards

Manoj

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Simon Kelly
Senior Engineer | Dimagi South Africa