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
}
)
I have the login working except for adding "CurrentUser.Title" that is pulling from my collection.
What am I missing here?
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.
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.
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.