Problems checking if a user is a member of a permission group within InfoPath 2013

Donna Artis 1 Reputation point
2020-10-22T14:45:11.58+00:00

Hi all,

I've previously used the details held within this post and it's worked great before
http://www.hishamqaddomi.ca/spg/index.php/sharepoint-2010/30-infopath/65-checking-if-a-user-is-a-member-in-a-sharepoint-group-within-web-infopath-2010-forms

I've just created a new form and a different site, but now the IsGroupMember field is still 0 whether i'm in the permission group or not. It's like the count function isn't working.

Any ideas?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,236 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,016 Reputation points
    2020-10-23T07:57:49.977+00:00

    Hi @Donna Artis ,

    Per my test, I got the same results as yours. The IsGroupMember field always shows 0.

    Per my research, the LoginName of user in SharePoint is like this: i:0#.w|contoso\michael. So you need to make the below changes:

    For CurrentUser field, convert it to lower case with translate function.

    • Select Insert Function
    • In the categories section select Text and then on the right select translate as the function
    • Remove the second double click to insert field and replace it with "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (including the quotiation marks)
    • Remove the third double click to insert field and replace it with "abcdefghijklmnopqrstuvwxyz"(including the quotiation marks)
    • For the first parameter double click on double click to insert field as the article shows. translate(Value[Name = "AccountName"], "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")

    34565-image.png

    For the IsGroupMember, set the value like this:

    Insert the the count function, then click double click to insert field. You need to choose dataFields instead of queryFields in GetUserCollectionFromGroup:

    34527-image.png

    Then click filter data and add a new filter, you need to choose contains for the second drop down:
    34555-image.png

    In the last drop down, choose use a formula and click insert a field or group. Insert the CurrentUser field:

    34534-image.png

    The filter should look like this:

    34544-image.png

    This works for me:

    34476-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.