cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianJ
Helper IV
Helper IV

User login help

I am trying to have a login screen for my app that captures the user that is logged in with a collection.  The reason I am doing this is so that when I send an email to the agents it will show in the body of them email the name of the installer.  Right now I have 3 users using the app with an installer dropdown to select who has installed it.  The code I am using for that is below.  Everything works except for the "ThisItem.FSInstallers.Value"

Office365.SendEmail(
    ThisItem.Email,
    "Installation at : " & ThisItem.Address,
    "Thank You " & ThisItem.Agent & "<br><br>" & "Your sign at " & ThisItem.Address & " has been installed by " & ThisItem.FSInstallers.Value,
    {
        Bcc: "installs@installs.com",
        Attachments: MyPhoto,
        Importance: "High",
        IsHtml: true
    }
)


Login.JPG 

I have the login working except for adding "CurrentUser.Title" that is pulling from my collection.

 

What am I missing here?

5 REPLIES 5
Pstork1
Dual Super User
Dual Super User

The identity of the user running the Power App is already available to you using the User() function.  User().Email would provide you with the email address of the user running the Power App without needing to create a login screen.  You can't change the identity of the person running the app with a login screen so I'm not sure why you don't use what is already there.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

The users I have that are using the app are all using the same email to login to the app.  I am trying to send an email to a client showing who actually installed the sign.

The problem with that approach is that each of those users needs to have an individual license, but if they are sharing the login then there is only one license involved.  That's a violation of the license agreement and its also a bad idea from a security standpoint to share a login.  Each user should be logging in with their own email address.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Yes you are correct and I am now using it that way.  The email function now works with User().FullName to just display the name of the user.  Inside the gallery how do I use this?  Before I had ThisItem.FSInstallers.Value and now I'm not sure how to display the user on that certain item.

Are you filtering the items displayed in the gallery to only show the ones for the current user?  Or do you want to show a field in the list that displays which user is the Installer, whether they are logged in or not?

 

Either way, if its a people field in SharePoint you should be able to display it as thisitem.columnname.email or thisitem.columnname.displayname.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,632)