Page 1 of 1

Forms Designer Groups

Posted: 06 Oct 2021
by UDRO
Hello,

I want to check, if user is in a sharepoint-group.

In the form there are two fields:

a) group-name as string (grouptxt)

and

b) group-name as user and group-field (groupusr)


I tried this:
  • IsCurrentUserMemberOfGroup([grouptxt])

    IsCurrentUserMemberOfGroup([groupusr])

    IsCurrentUserMemberOfGroup(‘grouptxt’)

    IsCurrentUserMemberOfGroup(‘groupusr’)
Unfortunatly nothing worked.

Can you tell me the correct syntax?

Thank you again.

Re: Forms Designer Groups

Posted: 06 Oct 2021
by Nikita Kurguzov
Dear URDO,
Where are you trying to check this? Are you trying to check it in JavaScript editor or in Group Editor > User-defined rules? - https://spform.com/documentation/groups

Re: Forms Designer Groups

Posted: 06 Oct 2021
by UDRO
Group Editor

Re: Forms Designer Groups

Posted: 06 Oct 2021
by Nikita Kurguzov
Dear UDRO,
There is an example in the documentation, here:

Code: Select all

IsCurrentUserMemberOfGroup(‘Members’)
As you can see, it just uses group name as a string 'Members'

Please, note, that only SharePoint groups can be checked this way, these ones:
SPGroups.png
SPGroups.png (37.83 KiB) Viewed 11219 times

Re: Forms Designer Groups

Posted: 06 Oct 2021
by UDRO
Dear Nikita,

this works fine if I write one group-name into the condition between the quotes as a constant.

But I have to get the group-name from fd.field, where they are in. In the rule they are varialble.

There are 40 different groups, which can appear in fd.field. They differ from record to record.

So it would be great, if the rule could take the value from the fd.field.


I hope you can understand my bad explanations.

Thank you for everything.

Re: Forms Designer Groups

Posted: 06 Oct 2021
by Nikita Kurguzov
Dear URDO,
Not sure this will work, but you can try:

Code: Select all

ContainsCurrentUser([FieldName])