How only make a form visible to certain mobile users?

Hello all –

Inside my application, I am looking for a way to make it so that some of
the forms only appear to a given mobile user if they are a certain type or
group of user.

For example, we have many different clinics that will use my "Clinic"
app… But one of the forms inside that app, the form called “ART,” I only
want to be visible to mobile users that I know are workers at clinics that
are doing ART.

I have been looking at what is probably the appropriate place for this
configuration – When I go to the main page for the form, I go to
Settings>Logic and I can put something into Display Condition.

But I am not sure how to tell that feature “Display it if the current
mobile user is in Group XXX” Or "Display it if the current mobile user’s
username begins with “a” . or other things that are based on the current
mobile user.

and maybe that “Logic” section is in fact not the best place to configure
this.

Could you give me a tip on the best way to ensure that only users that I
have designated as being related to “ART” are able to see or go into the
"ART" form?

THANKS! --Eric

Hi Eric,

Have you tried to retrieve the custom user property with instance(‘commcaresession’)/session/context/my_property_name inside the Settings > Logic > Display Condition of your form ?

Regards,

Charles

··· On Tuesday 09 June 2015 23:54:43 Eric Stephan wrote: > > Hello all -- > > Inside my application, I am looking for a way to make it so that some of > the forms only appear to a given mobile user if they are a certain type or > group of user. > > For example, we have many different clinics that will use my "Clinic" > app... But one of the forms inside that app, the form called "ART," I only > want to be visible to mobile users that I know are workers at clinics that > are doing ART. > > I have been looking at what is probably the appropriate place for this > configuration -- When I go to the main page for the form, I go to > Settings>Logic and I can put something into Display Condition. > > But I am not sure how to tell that feature "Display it if the current > mobile user is in Group XXX" Or "Display it if the current mobile user's > username begins with "a" . or other things that are based on the current > mobile user. > > and maybe that "Logic" section is in fact not the best place to configure > this. > > Could you give me a tip on the best way to ensure that only users that I > have designated as being related to "ART" are able to see or go into the > "ART" form? > > THANKS! --Eric > >


Charles Flèche
mHealth Advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org

Great information, thank you! I will take a look at these –

Eric

Eric,

This is definitely supported by the platform, but is a bit manual at the
moment and treated like an advanced feature.

You can read up on Form Display conditions (which control whether a form is
displayed) here:
https://confluence.dimagi.com/display/commcarepublic/Form+Display+Conditions

And the “Custom user data” setup here:
https://confluence.dimagi.com/display/commcarepublic/Custom+User+Data

At the bottom of the custom user data confluence page there is a section
titled

“Use a Custom User Data in a Display Condition”

which outlines what you are trying to do.

-Clayton

··· On Wed, Jun 10, 2015 at 4:44 AM, Charles Flèche wrote:

Hi Eric,

Have you tried to retrieve the custom user property with
instance(‘commcaresession’)/session/context/my_property_name inside the
Settings > Logic > Display Condition of your form ?

Regards,

Charles

On Tuesday 09 June 2015 23:54:43 Eric Stephan wrote:

Hello all –

Inside my application, I am looking for a way to make it so that some of

the forms only appear to a given mobile user if they are a certain type
or

group of user.

For example, we have many different clinics that will use my “Clinic”

app… But one of the forms inside that app, the form called “ART,” I
only

want to be visible to mobile users that I know are workers at clinics
that

are doing ART.

I have been looking at what is probably the appropriate place for this

configuration – When I go to the main page for the form, I go to

Settings>Logic and I can put something into Display Condition.

But I am not sure how to tell that feature "Display it if the current

mobile user is in Group XXX" Or "Display it if the current mobile user’s

username begins with “a” . or other things that are based on the current

mobile user.

and maybe that “Logic” section is in fact not the best place to
configure

this.

Could you give me a tip on the best way to ensure that only users that I

have designated as being related to “ART” are able to see or go into the

“ART” form?

THANKS! --Eric

Charles Flèche

mHealth Advisor

Télécoms Sans Frontières http://www.tsfi.org

Première Urgence - Aide Médicale Internationale http://www.pu-ami.org


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.

Hi @Clayton_Sims, I am also trying to do this for my CommCare app. However, the Display Conditions free-text field does not seem to be displayed in the Settings portion of my case list. See the image below:

Is there a reason why this is happening? Many thanks for your help. I look forward to hearing from you.

You can add this section by enabling the "Logic" portion in the settings menu next to the "Saved" button as outlined here.