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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Clearcollect(adminlist...
Power Apps
Unanswered

Clearcollect(adminlist) question

(0) ShareShare
ReportReport
Posted on by 45

I'm trying to run my first PowerApp using the helpdesk template that is in PowerApps. I've pretty much got everything where I want, however I'm having an issue with the Login as admin button. 

 

As i've seen on a couple other posts here the ClearCollect(AdminList) in the "ondemand" section of the app screen is where this is defined. I have defined 2 users in this list, using the same format in the other posts and the instructions that Microsoft has posted, (user's email address), however i still can't get logged in as admin no matter what I try. 

 

I also saw it posted that if i put a label on any page and give it the formula myprofile.mail that would display the format i should be using for this, however when i create a new label and set the text to myprofile.mail and play the app, nothing is displayed. 

 

Does anyone have any tips for a first timer like me on this? I've uploaded a few pictures to help explain it better. 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @koechsle , 

     

    Kindly use User().Email instead of myprofile.mail and this will solve the issue. 
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • v-xida-msft Profile Picture
    on at

    Hi @koechsle ,

    Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:5.JPG

     

    6.JPG

    Please check if you have typed/specified your email address within the AdminList collection in OnStart property of App control.

     

    If you have already typed/specified your email address within the AdminList collection in OnStart property of App control, please consider modify the formula within the OnSelect property of the "Login as a Help Desk Admin" button to following:

    If(Lower(MyProfile.Mail) in Lower(AdminList.Value), Set(isAdmin,true),Set(isAdmin,false)); /* <-- Modify formula here */
    If(isAdmin,Navigate(MyTicketsScreen,None),Set(ShowAccessError,true))

    then you need to save your app, and re-load it, check if the issue is solved.

    Note: If you modify the AdminList collection within the OnStart property of App control, you need to re-fire the OnStart property of your app, otherwise, the modification would not take effect. You could consider click the "Run OnStart" property to re-fire the OnStart property of your app:8.JPG

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • koechsle Profile Picture
    45 on at

    @yashag2255 

    This allowed the text box to show the currently logged in user, but even copy/pasting that to the adminlist didn't fix the issue. 

  • koechsle Profile Picture
    45 on at

    I've tried your solutions, but i'm still getting the same error message, and not allowed to log in to the app as an admin. 

     

    ClearCollect(AllTickets,HelpDesk);
    ClearCollect(TaskCategories,"LAPTOP / PC equipment issue","LAPTOP / PC software issue");
    ClearCollect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED","DEFERRED","WAITING ON CSR");
    ClearCollect(TaskPriority,"HIGH","MEDIUM","LOW");
    Set(MyProfile, Office365Users.MyProfile());
    ClearCollect(AdminList,"myemailaddress", "another user's email");
    Set(RunFlow,false)

     

    I've tried to copy the settings in screenshots for @v-xida-msft 's solutions, but was still unable to fix th issue. Do you have any other words of wisdom?

  • OK29 Profile Picture
    388 on at

    Hi,

     

    If you created users in trial license and if there is no email accounts for those users in exchange server, then above formula doesn't work. Use "UserPrincipalName" instead of mail.

     

    Select the login as admin button and then go to formula and then update as shown below.

    If(MyProfile.UserPrincipalName = "yourusername",Set(isAdmin,true),Set(isAdmin,false));
    If(isAdmin,Navigate(MyTicketsScreen,None),Set(ShowAccessError,true))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard