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 message 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 =

Hi Erin,

You can access custom user data
https://confluence.dimagi.com/display/commcarepublic/Custom+User+Data using
this expression: instance('commcaresession')/session/user/data/usertype

Hope that helps! Also, this mailing list is for the development of the
CommCareHQ website. Questions regarding app building should go to
commcare-users@googlegroups.com.

Ben

··· On Mon, May 15, 2017 at 12:06 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 message 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 =

--


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

Hi Erin

That expression should definitely work. In the backend we expand it to the
expression that Ben mentioned. I've tested that
"#session/user/data/usertype" does indeed get converted
to "instance('commcaresession')/session/user/data/usertype".

If you continue to experience this error please could you report an issue
to our support team.

Thanks

Simon Kelly
Director of Server Engineer | Dimagi

··· On 15 May 2017 at 16:14, Ben Rudolph wrote:

Hi Erin,

You can access custom user data
https://confluence.dimagi.com/display/commcarepublic/Custom+User+Data using
this expression: instance('commcaresession')/session/user/data/usertype

Hope that helps! Also, this mailing list is for the development of the
CommCareHQ website. Questions regarding app building should go to
commcare-users@googlegroups.com.

Ben

On Mon, May 15, 2017 at 12:06 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 message 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 =

--


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

Thanks, but I've tried both of those expressions, and I keep getting 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. I'm I mistyping somewhere? I can't
figure it out.

https://lh3.googleusercontent.com/-iHlUrCkWZZ0/WRmW79nvoyI/AAAAAAAABFY/x5vUiqZkTvMQQPuCud7EhnS9nMVu3L7AwCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.53.58%2BAM.png

https://lh3.googleusercontent.com/-AgnWDjxH2ac/WRmWlrCQewI/AAAAAAAABFU/0frclrTf3MsAOA0HpN8pjpOz0a_BRfmCQCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.49.42%2BAM.png

https://lh3.googleusercontent.com/-z8XKBNwz88I/WRmW_lqdXGI/AAAAAAAABFc/-RVMUUYKcXICdBDN-Xu9ov2jIBj-ey_0QCLcB/s1600/Screen%2BShot%2B2017-05-15%2Bat%2B11.54.21%2BAM.png

··· On Monday, May 15, 2017 at 10:50:14 AM UTC, Simon Kelly wrote: > > Hi Erin > > That expression should definitely work. In the backend we expand it to the > expression that Ben mentioned. I've tested that > "#session/user/data/usertype" does indeed get converted > to "instance('commcaresession')/session/user/data/usertype". > > If you continue to experience this error please could you report an issue > to our support team. > > Thanks > > Simon Kelly > Director of Server Engineer | Dimagi > > On 15 May 2017 at 16:14, Ben Rudolph <brud...@dimagi.com > wrote: > >> Hi Erin, >> >> You can access custom user data >> using >> this expression: instance('commcaresession')/session/user/data/usertype >> >> Hope that helps! Also, this mailing list is for the development of the >> CommCareHQ website. Questions regarding app building should go to >> commcar...@googlegroups.com . >> >> Ben >> >> On Mon, May 15, 2017 at 12:06 PM, Erin Sullivan <esu...@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 message 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 = >>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "CommCare Developers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to commcare-developers+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 Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-developers+unsubscribe@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >

usertype= it will work, usertype must be case property and this property needs to some data you should try with new data entry. and 'test' this type options.

usertype = 'test'