cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IMathur
Helper V
Helper V

2 types of users implementation with with different privileges

Hi Experts,

I am trying to make an app with project management capabilities. I want to have 2 types of end users of my PowerApps App: Admin and General.

Admin will have rights to edit the forms and 

General will have rights to only view the form

Now my question is, how will a user who logins in into the app will know, which kind of user he is, is there a flow or something can be provided for this? Like in below screen, in this case i have added just a text 'Admin User' , how can i modify it for the type of user login. Suppose if the user who doesn't have edit privileges in the app, i  want 'General User'  to be written here automatically on login.

 

Capture.PNG

 
2 ACCEPTED SOLUTIONS

Accepted Solutions
PVosEska
Resolver IV
Resolver IV

Hi IMathur,

 

Im afraid you asked the question in the wrong board. You should try the PowerApps board for PowerApps questions next time, But i'll still try to help.

 

Is the app connected to any database? For example, if you are using sharepoint lists, you could create a separate list, which will hold 'Admin names'. Then on the Onstart Property of your app, you could try something like:

Set(currentRole,If(!IsEmpty(Filter(<adminlist>,Email = User().Email)),"Admin","User")

 

This will filter your list on the current user's email, and return any rows that have that email. If the returned values are not empty (so it found the email) it will set the currentRole variable to Admin.

 

Then on buttons and labels you can use: If(currentRole = admin,<Your formula for admins>,<Your formula for users>)

 

Hope this can get you started

View solution in original post

Thanks a lot  @PVosEska ,

 

This formula worked using the IsBlank in place if IsEmpty somehow and for the label i put in Label>Text> currentrole and the formula worked and i am able to see the text on the basis of the user in admin list

View solution in original post

4 REPLIES 4
PVosEska
Resolver IV
Resolver IV

Hi IMathur,

 

Im afraid you asked the question in the wrong board. You should try the PowerApps board for PowerApps questions next time, But i'll still try to help.

 

Is the app connected to any database? For example, if you are using sharepoint lists, you could create a separate list, which will hold 'Admin names'. Then on the Onstart Property of your app, you could try something like:

Set(currentRole,If(!IsEmpty(Filter(<adminlist>,Email = User().Email)),"Admin","User")

 

This will filter your list on the current user's email, and return any rows that have that email. If the returned values are not empty (so it found the email) it will set the currentRole variable to Admin.

 

Then on buttons and labels you can use: If(currentRole = admin,<Your formula for admins>,<Your formula for users>)

 

Hope this can get you started

hi @PVosEska,

Appreciate your response, Thanks a lot!

I tried implementing this formula, for OnStart, Powerapps is accepting the formula with no errors, but when i create the label and put this variable name in text property of label, it is not recognizing the variable, could you please help me with this

Thanks a lot  @PVosEska ,

 

This formula worked using the IsBlank in place if IsEmpty somehow and for the label i put in Label>Text> currentrole and the formula worked and i am able to see the text on the basis of the user in admin list

Sorry for the mix up.

IsBlank() is used to check for a empty value in text or record, IsEmpty() is used for checking if a collection/list/table is empty.

 

Glad you got it to work, i was on holiday, so i couldn't respond sooner.

 

Regards,

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,531)