web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can someone help me fi...
Power Apps
Answered

Can someone help me figure out why CheckMemberGroupsV2 is failing?

(0) ShareShare
ReportReport
Posted on by 27

Hi there,

 

I created an app which is linked to a google sheets data source. The data source contains a list of emails. I want to check if these emails are in an Azure AD group and if they are not then I want the record associated with the email to be removed from the google sheets data source.

So far, I have the line below:

RemoveIf(Sheet1, IsEmpty(AzureAD.CheckMemberGroupsV2(email,["48ce8a71-7762-46e0-9eea-4f26059d21fa"]).value))

 

However, I am getting the error message:
"Resource 'testing' does not exist or one of its queried reference-property objects are not present."

 

The google sheets database currently only has two emails in it. One email is an email that is the Azure AD (therefore it's record shouldn't be deleted) whereas the other email is called "testing" and this email isn't in the Azure AD therefore the record should be deleted.

 

Could someone explain to me why CheckMemberGroupsV2 is failing? From the documentation I read it seems it should return an empty result if the email isn't in the google sheets database instead of failing.

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Xpholio ,

     

    Could you please try to modify the code as follows to see if it works?

    RemoveIf(Sheet1, EmailColumn=If(IsEmpty(AzureAD.CheckMemberGroupsV2(email,["48ce8a71-7762-46e0-9eea-4f26059d21fa"]).value),email))

     

    Hope this helps.

    Sik

  • Xpholio Profile Picture
    27 on at

    Hi, I tried modifying the code to the code you provided but I am still getting the same error (the only thing different about my code compared to your code is I changed EmailColumn to email since email is the name of the EmailColumn). I then tried adding a false condition as well ("") to see if that would change anything but it didn't.

     

    I have included a screenshot of the error below and a screenshot of my database.

    Screenshot (6).png

    database.PNG

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Xpholio ,

     

    OK, I got it. The first error message is from API server that if the email is not contained in the group, this error shows.

    We can use IfError() function to detect this error, so please try to modify the Remove formula as follows.

    ForAll(Sheet1.em As V,IfError(AzureAD.CheckMemberGroupsV2(V.em,["48ce8a71-7762-46e0-9eea-4f26059d21fa"]).value,RemoveIf(Sheet1,em=V.em)))

     

    The second error message shown in the screenshot4 seems to be a conflict error for google sheet in ForAll loop. 

    Could you confirm that the required fields for the sheet are being patched please?

     

    Sik

  • Xpholio Profile Picture
    27 on at

    Unfortunately after modifying the remove formula to the formula you provided I still am getting that 2nd error so the fields aren't being patched. Screenshot (8).png

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Xpholio ,

     

    So wired, as that formula work perfectly on my side.

    Another alternative workaround, try to use GetGroupMembers function to obtain all members in group and use Condition to check whether sheet1 emails are in the group.

    ClearCollect(colGroupUsers,AzureAD.GetGroupMembers("a901f3f1-ad65-4007-a324-034f24112470").value);
    ForAll(RenameColumns(Sheet1,"email","em"),If(Not(em in colGroupUsers.mail),RemoveIf(Sheet1,email=em)))

     Hope this helps.

    Sik

  • Xpholio Profile Picture
    27 on at

    Great thank you, this solution worked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard