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 Apps
Answered

Dynamic Collection

(0) ShareShare
ReportReport
Posted on by 14

Hello everyone! I am a fairly new person, who has only started to use the Power Platform recently. I am building an app in PowerApps, and i came across an issue. Due to license limitations, (and with me not having Office 365) i store data in CDS. What i would like to do for my app, is to have a login, that'd based on the users role, navigate them to different screens. I've managed to do this sort of by hard coding their full name and email into 3 different collection groups, that corresponds to the roles as well assigns a value to those groups (user, admin, head admin). I looked around but so far not found a working solution for it, and im curious.: Is it possible to have a collection that would dynamically update each time the app starts, and grab the users from the source column (felhasznaloks) based on their role? The email and fullname columns are both set to be text types, with the fullname being a rollup column that combines first name and last name columns.

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    Rather than loading a table of all possible users into the app, I've done what you're describing simply by doing a LookUp() to the permissions/role table using User().Email to return either a boolean value or some sort of string to indicate role. Then, I Set() a global variable as appropriate based on the LookUp() and control screen logic from there.

     

    Would that work for your case?

    Bryan

  • NRichárd Profile Picture
    14 on at

    Hi Bryan, i am gonna give it a try, although at the moment, the users that i have in the app, are not real people but sort of filler data. I thought that User().Email would only work if person using the app has a powerapps or microsoft account? After also doing some brainstorming, i thought up a few ideas that i might give a go, and see if they'd work. Albeit, one of them seems a bit complicated, as it'd use Power Automate and JSON. Once i do tried them out and has some results i will be telling about it.

  • NRichárd Profile Picture
    14 on at

    If it helps, this would be only required at one screen, which is a login screen. Users would enter their email and fullname, and if that matches the one in the database (CDS) then it would navigate them to the corresponding screens. For the collection one, i used switch ,and the navigation as well logging worked nicely, issue that i had, is what im trying to solve now with my question and others help, is to make this dynamic or easier to use, so in case of a newcomer, then there would be no need to mess with the code, and have it function properly on its own. Once they would be in, then it is done, as the different screens have been setup in a way that they can only be accessed by the landing screen (usermain, admin main, headadmin screen).

  • NRichárd Profile Picture
    14 on at

    Thanks Bryan, i had to play around a bit with the lookup function, but i was able to figure out a solution for it. I made a Switch function that based on the role variables, made by the lookup function onstart, would check the users name and emails based on the text inputs, and if corrects, lets them use the app, otherwise it disables them the login button and displays a warning.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 644

#3
11manish Profile Picture

11manish 626

Last 30 days Overall leaderboard