Solved

fn-isMemberOfGroup and a variable?

  • 17 August 2016
  • 4 replies
  • 123 views

Userlevel 3
Badge +9

I have a drop down that is used to pick a "group" name.

 

I want to use the fn-isMemberOfGroup() function to display a section only if the member is part of a group based on that drop down.

 

Example: Dropdown field (named "Industry") includes:

Industry1

Industry2

Industry3

 

I have 3 sharepoint groups (each with membership visibility set to Everyone)

Industry1 Viewers

Industry2 Viewers

Industry3 Viewers

 

I've tried every combination I can think of to get this to work

  • fn-isMemberOfGroup("Industry1 Viewers")     -- manually type name, works fine
  • fn-isMemberOfGroup(Industry+" Viewers")     -- does not work 
  • fn-isMemberOfGroup("Industry Viewers")       -- does not work
  • fn-isMemberOfGroup(Industry Viewers)          -- does not work
  • fn-isMemberOfGroup(""+Industry+" Viewers")  -- does not work
  • fn-isMemberOfGroup(Industry" Viewers")        -- does not work

 

Is this possible?  Am I messing up the syntax?

icon

Best answer by brentless 6 January 2017, 02:30

View original

4 replies

Userlevel 4
Badge +11

Hi, are you using the Named Control or the Item Property to get the Industry value? You should use the Named Control in order to have the current value and not the one that was in the form when it's opened.

If you're already using the Named Control, could you try to create a calculated field, where you concatenate the Industry field and the text " Viewers" and then use it in the function?

Giacomo

Userlevel 3
Badge +9

Tried both of those with no luck unfortunately. I am mainly using the Named Control. I can do a calculated field that creates the string and generates the correct concatenated string, which still doesn't work as the passed value, but it's as if that function can ONLY accept a hard codes string in quotes...

Get Outlook for Android<https://aka.ms/ghei36>

Userlevel 4
Badge +11

Hi,

looking for additional details about the parameter of fn-ismemberofgroup I've found this:

http://help.nintex.com/en-US/O365/Default.htm#O365Forms/Visual reference/Insert Reference pane.htm

Looking at Inline function description, it looks like that inline functions are evaluated only when the form is loaded and not at runtime, so in your case it could be that the named control is empty on load so it doesn't match anything..could you try to select an industry and save the item and see if, opening that item, the function is correctly evaluated?

Giacomo

Userlevel 3
Badge +9

I finally got around to implementing this.  For anyone interested, pretty much the answer is it can't be done.  As of right now, the fn-isMemberOfGroup function must take a straight up text string (no variables).

To resolve what I needed, I created a super long list of  "OR" strings

=CONCAT(" || ({ItemProperty:Operating_x0020_Company}==""",A4,""" &amp;&amp; fn-IsMemberOfGroup(""",B4," Managers""))")

Where Column A was the name of the Operating Company and B is the display name of the corresponding group.  Then concatenated about 30 rows together to have a very long comparison statement.

A rather unimpressive solution, but it accomplishes the task

Reply