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.
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.
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).
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.
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
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2