fn-IsMemberOfGroup not working like I think it should


Badge +5

I have a form that I'm trying to validate off of a usergroup I created:

Capture.PNG

POApprovers is a SharePoint group. No matter what name I put in, it will not accept the name. The goal is to only submit if they type in a name from this group. Is there another way I could do this or am I going about this the wrong way? I seen where some people say it magically started working for them, or deleting the field and re-adding it fixes it, but not for me so far. Thanks everyone!


12 replies

Badge +16

what sort of field is this on your form?

Badge +5

Sorry, it's a "person or group"

Badge +16

so you're trying to restrict the user seleted in the people picker to be only members of a certain group?  why don't you do that in the list settings, column settings?

Badge +5

Hi Cassy, I tried that approach as well but it was acting funny. It would only allow people from that group to use that field. So if you weren't in that group, it wouldn't allow any name to be resolved. I want everyone to be able to use that field, but validate it from a certain group in SharePoint

Badge +16

so you want them to be able to enter anyone in there but then have validation error if the resolved person isn't a member of the group?

Badge +5

Correct. Or do you know of an easier way to accomplish this?

Badge +7

Hi,

Could you check to make sure your POApprover group settings are like this:

185508_pastedImage_0.png

It may be set to Group Members only view.

Jan

Badge +16

ah good shout Jan Eyres

Badge +5

Just made this change Jan, but it is still not letting me submit with using someone's name in that group.

Badge +7

Hi,

You can remove any validation you've got on the field now and you should be ok.

Jan

Badge +5

That did it! thank you all so much!

Badge +7

So just to be clear, the answer in this case was to not use the inline function fn-isMemberOfGroup for validation of a People control because it doesn't work / can't be used for this purpose.

Instead, as per Cassy Freeman's post you can enforce people validation via the SharePoint List Settings > Column Settings for the People and Control column with the following setting:

207942_Picture1.png

Also, as per  post you should also ensure that everyone can view the membership of the group.

The result of this is that only users from the specified SharePoint Group will be queried / auto-completed / allowed in this control on your form. Hope this helps anyone who might be searching for this issue (as I was), because the current "correct answer" is just an interim step.

Reply