Filter modules by user type for newest version of CommCare

Hi All,

I'm trying to filter my modules by user type so only certain users have
access to certain modules. I followed the instructions on the help site (
https://confluence.dimagi.com/display/commcarepublic/Module+Filtering) by
creating custom user data, but I think this help site is outdated, as when
I try to test the app, I get an error messages that the expression "#session/user/data/usertype"
is invalid. Does anyone know what expression I should use? I've also tried
session/user/data/usertype without the # in the beginning, and just
usertype =

And I just tried the expression instance('commcaresession')/session/user/data/usertype
= 'mobilizer' and got the error message: Logic references
instance(commcaresession)/session/user/data/role which is not a valid
question or value.

Please see the attached screen shots.

https://lh3.googleusercontent.com/-6sIUIi9fih8/WRmY4nHGGSI/AAAAAAAABFs/159j_MlqjRsRY8CI1hLZP5wa7ngBL-ZgwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.49.42%2BAM.png

https://lh3.googleusercontent.com/-hXkov94PB8A/WRmY7OaBrBI/AAAAAAAABFw/_b2jJLVzxMovQJrxgcEyH4JN9hCkH7evQCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.54.21%2BAM.png

https://lh3.googleusercontent.com/-joHDcbNogDA/WRmYyLztenI/AAAAAAAABFo/Hkjug9qkxuM4hMiH0e3p4xc1M0l9a5aPwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.53.58%2BAM.png

Confusingly enough, the Role datum does not get sent down to the phone, and
thus there is no way to access that which is why commcare is complaining
about role. If you remove that reference, you should be in the clear. If
you need a role datum, you can add another key to your user data that
specifies the role that the mobile user is.

Ben

··· On Mon, May 15, 2017 at 2:02 PM, Erin Sullivan wrote:

Hi All,

I'm trying to filter my modules by user type so only certain users have
access to certain modules. I followed the instructions on the help site (
https://confluence.dimagi.com/display/commcarepublic/Module+Filtering) by
creating custom user data, but I think this help site is outdated, as when
I try to test the app, I get an error messages that the expression "#session/user/data/usertype"
is invalid. Does anyone know what expression I should use? I've also tried
session/user/data/usertype without the # in the beginning, and just
usertype =

And I just tried the expression instance('commcaresession')/session/user/data/usertype
= 'mobilizer' and got the error message: Logic references
instance(commcaresession)/session/user/data/role which is not a valid
question or value.

Please see the attached screen shots.

https://lh3.googleusercontent.com/-6sIUIi9fih8/WRmY4nHGGSI/AAAAAAAABFs/159j_MlqjRsRY8CI1hLZP5wa7ngBL-ZgwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.49.42%2BAM.png

https://lh3.googleusercontent.com/-hXkov94PB8A/WRmY7OaBrBI/AAAAAAAABFw/_b2jJLVzxMovQJrxgcEyH4JN9hCkH7evQCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.54.21%2BAM.png

https://lh3.googleusercontent.com/-joHDcbNogDA/WRmYyLztenI/AAAAAAAABFo/Hkjug9qkxuM4hMiH0e3p4xc1M0l9a5aPwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.53.58%2BAM.png

--
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.

Erin,

To reference the custom user data, try the following:

#user/usertype = 'mobilizer'

This should restrict access to this module to users who have been
designated as mobilizers.

Hope this helps!

··· On Mon, May 15, 2017 at 8:23 AM, Ben Rudolph wrote:

Confusingly enough, the Role datum does not get sent down to the phone,
and thus there is no way to access that which is why commcare is
complaining about role. If you remove that reference, you should be in
the clear. If you need a role datum, you can add another key to your user
data that specifies the role that the mobile user is.

Ben

On Mon, May 15, 2017 at 2:02 PM, Erin Sullivan esullie@gmail.com wrote:

Hi All,

I'm trying to filter my modules by user type so only certain users have
access to certain modules. I followed the instructions on the help site (
https://confluence.dimagi.com/display/commcarepublic/Module+Filtering)
by creating custom user data, but I think this help site is outdated, as
when I try to test the app, I get an error messages that the expression "#session/user/data/usertype"
is invalid. Does anyone know what expression I should use? I've also tried
session/user/data/usertype without the # in the beginning, and just
usertype =

And I just tried the expression instance('commcares
ession')/session/user/data/usertype = 'mobilizer' and got the error
message: Logic references instance(commcaresession)/session/user/data/role
which is not a valid question or value.

Please see the attached screen shots.

https://lh3.googleusercontent.com/-6sIUIi9fih8/WRmY4nHGGSI/AAAAAAAABFs/159j_MlqjRsRY8CI1hLZP5wa7ngBL-ZgwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.49.42%2BAM.png

https://lh3.googleusercontent.com/-hXkov94PB8A/WRmY7OaBrBI/AAAAAAAABFw/_b2jJLVzxMovQJrxgcEyH4JN9hCkH7evQCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.54.21%2BAM.png

https://lh3.googleusercontent.com/-joHDcbNogDA/WRmYyLztenI/AAAAAAAABFo/Hkjug9qkxuM4hMiH0e3p4xc1M0l9a5aPwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.53.58%2BAM.png

--
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.

--
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.