Field Visibility on Community Name

Hello,

I am trying to hide a field depending on the user community. I am able to do this through field visibility rules using
User/SessionObject/sys_community = 1030. I am trying to see if I can somehow use the name of the community and not the id in the visibility rule. For e.g something like
User/SessionObject/sys_community LIKE ADMIN_COMM. Is there a way to achieve this?

The name is not generally used in the system. sys_community is always a number, so LIKE will not work. I don’t know of any way to do this w/o writing a custom extension.

Paul,

Thanks for the reply. I think it would be a great idea if we can have some built in functionality to hide fields by name of community similar to that of role. We cannot depend on id as they keep changing from environment to environment. Also, isn’t MSM looking at the name of a community rather than the id of it when pushing changes?

If you are using MSM to deploy, I believe you can map this id so that MSM will translate it when deploying to a different server. This would eliminate the problem you mention.

Hi, I know this is quite an old post but I wondered if anyone is having the same issue as me. I’ve set visibility on a field as follows:

User/SessionObject/sys_community = 1019

(1019 is the Admin community) but this only means the field’s label disappears when I’m logged in under a community that is not Admin.

I also tried using (from the visibility value selector dropdown):
Single HTML Parameter > sys_communityid

However, I still get the edit box for the field, only the label vanishes.

All ideas gratefully received!

Please ignore - all sorted! (user error!!)