cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beatrizmoura26
Helper II
Helper II

Creating login and password on powerapps with office 365 email users

Hello guys, is it possible to create a login screen with username and password for office 365 email on powerapps? Is there a tutorial or article?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Depending on what you mean by "can and cannot do". If you don't what people to make changes to records if they are not an "admin", start with you data source and control access here first. If you want a different "User Experience" like different buttons / screens etc., you can work with an extra table in your data source. Something like this:

 

Table: UserPermissions

UserEmailIsAdminIsManagerShowDebugShowStatistics
user1@domain.comtruetruetruetrue
user2@domain.comtruefalsetruetrue
user4@domain.comfalsetruefalsefalse

 

 

Now on the OnStart of your app you can do this to get the permissions for that user:

 

 

If(
   Not(
      IsBlank(
         LookUp(
            UserPermissions,
            UserEmail = User().Email
         )
      )
   ),
   // A record found is either Admin or Manager or both.
   Set(
    varUserPermission,
    {
        IsAdminVal: IsAdmin,
        IsManagerVal: IsManager,
        ShowDebugVal: ShowDebug,
        ShowStatisticsVal: ShowStatistics
    }
   ),
   // For non Admins or Managers
   Set(
    varUserPermission,
    {
        IsAdminVal: false,
        IsManagerVal: false,
        ShowDebugVal: false,
        ShowStatisticsVal: false
    }
)

 

 

 

For example if you have a container with labels somewhere on a screen with debug info, you could do this in the Visible property:

 

 

varUserPermission.ShowDebug

 

 

Now the debug info will only show if the user has permissions to see it. Same thing for a button that can redirect the user to a screen with statistics.

 

In this case there is no need for a password. If you don't want users to access your app in the first place. The best this is not sharing it with those users I guess.

 

This is just an basic example. It also al depend on what you really want to achieve and what your own permissions are at your environment.

 
The above is not tested and might not be the best solution. But just giving some examples that might get you a bit further. You can also have a look at Shane's video: https://www.youtube.com/watch?v=NqQGysNCac0

View solution in original post

Hi @beatrizmoura26 

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @beatrizmoura26 ,

Yes you could, but I am assuming you are going to use a different password as the user has already logged into Power Apps and established their credentials.

If so, you would just need a reference list with the user name and password required.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Power_Robert
Helper II
Helper II

Hi @beatrizmoura26,

 

Don't you already have to login into PowerApps.com or the PowerApps App using your Office 365 user credentials to even open the app? Can you please explain what you are trying to accomplish?

 
Sorry I think I was not clear.

I want to be able to define accesses. Example

Login x access as administrator

Login and access as a common user.

And from these accesses define what the user can and cannot do.

 

Depending on what you mean by "can and cannot do". If you don't what people to make changes to records if they are not an "admin", start with you data source and control access here first. If you want a different "User Experience" like different buttons / screens etc., you can work with an extra table in your data source. Something like this:

 

Table: UserPermissions

UserEmailIsAdminIsManagerShowDebugShowStatistics
user1@domain.comtruetruetruetrue
user2@domain.comtruefalsetruetrue
user4@domain.comfalsetruefalsefalse

 

 

Now on the OnStart of your app you can do this to get the permissions for that user:

 

 

If(
   Not(
      IsBlank(
         LookUp(
            UserPermissions,
            UserEmail = User().Email
         )
      )
   ),
   // A record found is either Admin or Manager or both.
   Set(
    varUserPermission,
    {
        IsAdminVal: IsAdmin,
        IsManagerVal: IsManager,
        ShowDebugVal: ShowDebug,
        ShowStatisticsVal: ShowStatistics
    }
   ),
   // For non Admins or Managers
   Set(
    varUserPermission,
    {
        IsAdminVal: false,
        IsManagerVal: false,
        ShowDebugVal: false,
        ShowStatisticsVal: false
    }
)

 

 

 

For example if you have a container with labels somewhere on a screen with debug info, you could do this in the Visible property:

 

 

varUserPermission.ShowDebug

 

 

Now the debug info will only show if the user has permissions to see it. Same thing for a button that can redirect the user to a screen with statistics.

 

In this case there is no need for a password. If you don't want users to access your app in the first place. The best this is not sharing it with those users I guess.

 

This is just an basic example. It also al depend on what you really want to achieve and what your own permissions are at your environment.

 
The above is not tested and might not be the best solution. But just giving some examples that might get you a bit further. You can also have a look at Shane's video: https://www.youtube.com/watch?v=NqQGysNCac0

@beatrizmoura26 ,

You do that at the start as the user is already logged in.

I do something very similar with a reference list with the user's email and authorities. I then at App OnStart do something like

Set(
   vUserMail,
   User().Email
);               //avoids delegation issues
Set(
   vAdmin,
   Lookup(
      MyReferenceList,
      UserMailField = vUserMail,
      Admin          //this is a true/false field
   )
)

I then have the Variable vAdmin to control what the user sees and does.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @beatrizmoura26 

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (3,172)