Hi everyone,
I had created this post earlier, but I think it didn't get created. Couldn't find the post even when I searched for it, so giving it another go.
I have a PowerApps form that is connected to a SharePoint Online list (please reference below):
The Default value for the Email Address field is:
First(Office365Users.SearchUser({searchTerm:Name.Text})).Mail
The Default values for Job Title and Department are similar, except the end of the string is replaced by .JobTitle and .Department.
This works great to return information for most users, but our organization has a group of users whose names follow a different naming standard, and their Display Names are ABCLastName, FirstName, and email addresses are FirstName.ABCLastName@Organization.com.
So when I use the above form to return user data, in order for the search to work, I'd have to enter in ABCLastName, FirstName.
What I'm trying to do is to be able to return user data by only entering the LastName, FirstName. I figure it should be possible to query our AD for the user Last name and First name fields. Does anyone know how best to go about achieving this? I've spent a bit of time trying to find out a solution, but have so far been unable to do so.
Thanks in advance, everyone!
Solved! Go to Solution.
Hi @Anonymous,
Do you create a custom form for your SP list using PowerApps?
The searchTerm property of the Office365Users.SearchUser() function is only applied to display name, given name, surname, mail, mail nickname and user principal name property of user profile. I suppose that your Office365Users.SearchUser() formula would filter Office 365 users based on display name or given name property (seaarchTerm applied to display name or given name).
More details about the Office365Users.SearchUser() function, please check the following article:
https://docs.microsoft.com/en-us/connectors/office365users/#search-for-users
I have made a test on my side, please take a try with the following workaround:
Set the Default property of the TextInput control within the Email Address Data card to following (or set Default property of the Email Address Data card to following):
First(
Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName)
On your side, it should be:
First(
Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName)
Set the Default property of the TextInput control within the Job Title Data card to following (or set Default property of the Job Title Data card to following):
First( Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName) ).JobTitle
On your side, it should be:
First( Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName) ).JobTitle
Set the Default property of the TextInput control within the Department Data card to following (or set Default property of the Department Data card to following):
First( Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName) ).Department
On your side, it shoud be:
First( Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName) ).Department
The GIF screenshor as below:
Best regards,
Kris
Hi @Anonymous,
Do you create a custom form for your SP list using PowerApps?
The searchTerm property of the Office365Users.SearchUser() function is only applied to display name, given name, surname, mail, mail nickname and user principal name property of user profile. I suppose that your Office365Users.SearchUser() formula would filter Office 365 users based on display name or given name property (seaarchTerm applied to display name or given name).
More details about the Office365Users.SearchUser() function, please check the following article:
https://docs.microsoft.com/en-us/connectors/office365users/#search-for-users
I have made a test on my side, please take a try with the following workaround:
Set the Default property of the TextInput control within the Email Address Data card to following (or set Default property of the Email Address Data card to following):
First(
Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName)
On your side, it should be:
First(
Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName)
Set the Default property of the TextInput control within the Job Title Data card to following (or set Default property of the Job Title Data card to following):
First( Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName) ).JobTitle
On your side, it should be:
First( Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName) ).JobTitle
Set the Default property of the TextInput control within the Department Data card to following (or set Default property of the Department Data card to following):
First( Filter(Office365Users.SearchUser(),DataCardValue1.Text in DisplayName || DataCardValue1.Text in GivenName) ).Department
On your side, it shoud be:
First( Filter(Office365Users.SearchUser(),Name.Text in DisplayName || Name.Text in GivenName) ).Department
The GIF screenshor as below:
Best regards,
Kris
User | Count |
---|---|
187 | |
105 | |
89 | |
45 | |
43 |
User | Count |
---|---|
237 | |
105 | |
104 | |
66 | |
66 |