Skip to main content

Hello,

 

I want to show / hide some controls based on the membership of the current user. the group i need to check is different per item, i need to check it based on a property (CountryName).

 

When i put the fn-ismemberOfGroup function in the expression as fn-IsMemberOfGroup("Norway"), it works fine. when i use the following expression the item property is never used, fn-IsMemberOfGroup("CountryName") however when i user a Common property it works fine.

 

Further i tried to use the fn-IsMemberOfGroup("CountryName") using a rule but that didn't work out either. Is it possible to use this function with a rule or expression at run time and put in a dynamic group name?

 

208967_pastedImage_1.png

Hi!

Try to remove quotes surrounding the "CountryName", so just: fn-isMemberOfGroup(CountryName)

Regards,

Tomasz


Unfortunately that makes no difference. with or without quotes it is not working.

Regards,

Sander


I confirm : if you set the GroupName manually, the function works well...if you retrieve it from Item Properties : doesn't work.


The function fn-isMemberOfGroup works with named/hardcoded groups. It doesn't work with names that comes from a variable


Hi ‌ if any from the above answers helped you with solving your issue, please mark one of them as "Correct", so that other users will be able to use it as a solution if they face a similar problem.

Regards,

Tomasz


When i use the common variable instead of a named/hardcoded groupname it works fine.

Do you know if it is on the planning to support the named controls or item properties?


What kind of column is "CountryName" in your list ? For me, it works with free text, on an on premise tenant.


The problem was not the column, the expression did not work on a multi line rich text box. So the function works fine but not on that specific control.


i added a new reply with the solution, it was not the item property but the control on the form that caused the problems..


Hi, 



 



Can we enter multiple group names here. I tried to do that by adding && which did not work.



 



Thank you in advance!



 



Regards,



Ronnie




@fhunth wrote:


The function fn-isMemberOfGroup works with named/hardcoded groups. It doesn't work with names that comes from a variable






 


I resolved this by using the And function from the Inline function tab.



 



Thank you again!



 



Best,



Ronnie.


Can you please share code how you got it working? I have created one form variable & set the value. But it's still not working by calling  fn-IsMemberOfGroup(variable Name).


Reply