cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Traconis1
Frequent Visitor

Office365Groups connector is not working on the published app

Hi everyone,

 

I have created the app and as an added functionality I added some controls only available to members of the specific security group.

 

In my App's OnStart property I included the following:

 

ClearCollect(DelegateUsers,Office365Groups.ListGroupMembers("56a53f4e-0000-0000-0000-000000000000").value);
If(User().Email in DelegateUsers.userPrincipalName ,Set(VarDelegate,true), Set(VarDelegate, false));
If(User().Email in DelegateUsers.userPrincipalName ,Set(currentUser,Blank()), Set(currentUser,User()));

 

I then added specific users to the security group (0's are just placeholders) and after the Azure sync I was able to test the app and it was working for each user.

I was able to confirm the collection (DelegateUsers) holds users visible on the AAD, I was able to correctly use VarDelegate and the currentUser variable was holding correct information.

 

However when I published the app and logged as the owner (and then as an non-owner and then as the standard user) the app asked for the Office365Groups connection (expected) but when the user clicked Allow - the app stopped working ie. the collection (DelegateUsers) was created correctly but the currentUser variable was set to blank.

 

Why the app works in edit and play mode but not after publishing. Are the non Owners requires some specific permission to be able to use Office365Groups connector?

13 REPLIES 13
BCBuizer
Multi Super User
Multi Super User

Hi @Traconis1 ,

 

According to you formula the currentUser variable is supposed to be set to Blank() when the current user is in the DelegateUsers collection, so that seems consistent with the behaviour you describe. Perhaps you want to reverse your If statement:

ClearCollect(DelegateUsers,Office365Groups.ListGroupMembers("56a53f4e-0000-0000-0000-000000000000").value);
If(User().Email in DelegateUsers.userPrincipalName ,Set(VarDelegate,true), Set(VarDelegate, false));
If(User().Email in DelegateUsers.userPrincipalName ,Set(currentUser,User()), Set(currentUser,Blank()));

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Thanks for the response @BCBuizer , and I apologise for the confusion.

 

As I stated before, the app works perfectly fine in the design (EDIT and PLAY) mode but it doesn't after the app is published.

I should have mentioned, on the next screen that variable's value (currentUser) change to a different value so the above is just example what I put into the OnStart. In fact I can remove that statement from and nothing changes ie. the app still works in the development mode but not after publishing.

 

Supporting question - is there a "place" on our tenant (via GUI or Powershell) where I can check if all PowerApps functions can be accessed by all users (sorry if that make a little sense but not sure how to formulate that query).

 

My suspicion is that some PowerApps functions which "read" data from the Azure AD may not be accessed by each user. Ie. User() function will work for everyone but Office365Groups won't. 

 

Cheers

BCBuizer
Multi Super User
Multi Super User

Hi @Traconis1 ,

 

The only things that comes to mind is the Data Loss Prevention policies in the Power Platform Admin center where certain connectors may have been disabled for certain environments or security groups, but I don't have experience with that to really point you in the right direction...



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Traconis1
Frequent Visitor

Thanks @BCBuizer ! I checked the policy and it seems all connectors I used in the app are not blocked. I will raise it with the Microsoft Support - maybe I found a bug? 🙂

BCBuizer
Multi Super User
Multi Super User

Hi @Traconis1 ,

 

I gave this a second thought and you mentioned the DelegateUsers collection is properly populated, so the issue shouldn't be in the Office365Users connector or use thereof.

 

This leads me to believe the issue is in the logic you are using to set the variables. Did you also test the co-owner and user scenarios in when the app is in edit mode?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Traconis
Frequent Visitor

Thanks for the response.

 

I tested the app in the Edit mode as:
Owner - the main service account with E5 licence

co-owner admin account - admin account without the licence but with near full Microsoft 365/Azure access

co-owner user account - standard user E5 licence account

 

In each test I was able to fetch the data according to the security group permission i.e.:

 

Service account is a member of the security group (Delegate users) as well as it has an email account etc. (E5 licence) so was able to use all properties later in the app - to compose email, display name etc.

 

admin account - member of the security group but without licence so I was able to do the same as above but without those features which requires user's email.

 

regular account without membership - the app correctly identifies the user without delegate access so it navigated to the correct screen hiding relevant controls as expected.

 

But everything above just works in the EDIT mode only :(. As soon as I publish the app, all users are asked to create/refresh a new connection (Office365Groups - as expected) but after doing that the app always returns

Set(currentUser,Blank()));

regardless if the user is in the security group or not. As a result the rest of the app functionality fails because it is not able to correctly identify the user.

 

Right now I reversed the app and removed/commented that part of the code so all calls to the currentUser variable are replaced with User() which works perfectly fine.

I still browsing the depths of the Internet to see if there is another way to allow delegation if the above doesn't work.

The logic (IMHO) is dead simple.

1. User can be a member of the security group called 'Delegation'

2. User sign in to the app

3. The app check if the user is a member of the security groups

4. If False assign the User() to the variable currentUser and use it throughout the app.

5. If True - display a table with all user's names and allow to check one

6. Assign the above choice to the variable currentUser and use it throughout the app ie. update the Sharepoint list with the currentUser.Name or send the email to currentUser.Email etc.

 

Traconis1
Frequent Visitor

Sorry @BCBuizer - the above is my other account (not sure how to link both of them 😞 )

BCBuizer
Multi Super User
Multi Super User

Hi @Traconis1 ,

 

Indeed this should be something really simple. And usually when it's something really simple but not working, it's because of some little detail that is overlooked. What you may consider is to add controls to the app which are only visible for certain test users and display the values of: DelegateUsers, VarDelegate and currentUser.

 

This allows you to compare the actual value against the expected value at certain points in your app after publishing.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Traconis1
Frequent Visitor

Thanks @BCBuizer ,


So far I was just watching variables and collections using built-in menu as well as looking at the input&output on the monitor. Your solution is the best, however most time consuming but looks like it is the only way to find this little error. The problem is the app can't be taken down for longer than 1-2 hours and I don't have resources to provision it in a separate environment for a different set of users :(.

I will follow your guide as well as reporting this to Microsoft at the same time (time critical) and provide updates here (looks like an isolated issue but I don't want to think my app is so sophisticated that nobody else encountered the same issue).

Brb!

Helpful resources

Announcements

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip: Community User Groups

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: Community User Groups and YOU Being part of, starting, or leading a User Group can have many great benefits for our community members who want to learn, share, and connect with others who are interested in the Microsoft Power Platform and the low-code revolution.   When you are part of a User Group, you discover amazing connections, learn incredible things, and build your skills. Some User Groups work in the virtual space, but many meet in physical locations, meaning you have several options when it comes to building community with people who are learning and growing together!   Some of the benefits of our Community User Groups are: Network with like-minded peers and product experts, and get in front of potential employers and clients.Learn from industry experts and influencers and make your own solutions more successful.Access exclusive community space, resources, tools, and support from Microsoft.Collaborate on projects, share best practices, and empower each other. These are just a few of the reasons why our community members love their User Groups. Don't wait. Get involved with (or maybe even start) a User Group today--just follow the tips below to get started.For current or new User Group leaders, all the information you need is here: User Group Leader Get Started GuideOnce you've kicked off your User Group, find the resources you need:  Community User Group ExperienceHave questions about our Community User Groups? Let us know! We are here to help you!

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!  

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA

Top Solution Authors
Top Kudoed Authors
Users online (5,083)