cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
reedd4
Frequent Visitor

Search 365 users in app -> Sharepoint

Hello!

I have created an app that works like the following.

1. Scan barcode (which is a discriminate ID).
2. Sharepoint list item created (via patch with OnScan or a button control).
3. A separate Flow searches for the ID in the o365 universe and edits the item with the display name.

Is there a way to wrap #3 into the app usage? I put the connector for O365 users in the app but I'm running into a wall on what to do with OnScan, for example. Each scanned barcode will definitely match in the system so there isn't a need to search and display results. Just scan the code, get the name associated with that ID, and make the SP list item.

 

Edit:
I've found the string for SearchUserV2 but I'm struggling to find the context of how to write the function to make it search, pull, and print the DisplayName from the Barcode Value (essentially Nickname)

1 ACCEPTED SOLUTION

Accepted Solutions
reedd4
Frequent Visitor

I got where I (thought) needed to be when I wrote the thing anyway;

I changed patch to
{Title: Office365Users.UserProfile(Concatenate("extra",BarcodeScanner1.Value,"extra")).DisplayName}

And it does exactly what I want now, albeit a bit slower than dropping the Raw value into the Sharepoint and letting a Flow do it on the backend. @ArchitectMadhan I will explore the FlowinApp bit now to see if it improves the refresh speed. I think your idea will let me backend the operation and speed up scanning.

View solution in original post

5 REPLIES 5
ArchitectMadhan
Responsive Resident
Responsive Resident

@reedd4 , If your goal is to read the bar code and find the username (nickname) from the O365 users and include it in the SharePoint list "New Item Form" and then allow the user to submit the New Item Form?

If you are already using Office365Users.SearchUserV2({searchTerm: SearchTerm.Text}) and is giving you the Emp ID, for fetching the user display name you can use Office365Users.UserProfile(InfoAbout.Text).DisplayName then you can use it in New Item Form - Text input control.

 

Please accept it as a solution and give thumbs up, if it works for you.

The end goal is to scan a barcode and have a sharepoint list item generated with the DisplayName. So multiple coded could be scanned in succession and you get a list of names, essentially.

I figured out how to use Office365Users.SearchUserV2({searchTerm: SearchTerm.Text}) and Top to get the result I want, but how do I access that search output for the patch function? Does using Office365Users.UserProfile(InfoAbout.Text).DisplayName have the results of SearchUser?

Edit: I think I'm going about this the wrong way. Since I know the discriminate ID I should probably be using "Get User Profile" though seems either should work

@reedd4 , Please follow the below steps to achieve your goal.

1. In Power Automate Flow: Create Power Apps -> Instant Flow (this is to create a SharePoint list item for each person scanned) ex: FlowInApp. Refer https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

2. In PowerApps:

    a. Form to scan the code,  the discriminate ID, you will get it, store that in a variable (varEmpID).

    b. now use varEmpDispName = Office365Users.UserProfile(varEmpID).DisplayName to get the display name of the person. 

    c. call the Power Automate Flow (ex: FlowInApp, created in the step #1) to create the user by providing the varEmpDispName (variable). calling flow and providing the parameter ->FlowInApp.Run(varEmpDispName)

 

  Please accept it as a solution and give thumbs up, if it works for you.

Since my current workflow has a Flow I was trying to bypass it. Is it not possible to run the profile-getting operation in the OnScan string? 

I've tried setting some variables and using Office365Users.Search, *.GetProfile, and *.UserProfile but I'm always getting arguments. Sorry I'm not sure exactly how to ask what's in my head.

What is more important is the speed of scanning, so if its going to add a lot of time to the sending process then maybe having a flow on the backend is best.



reedd4
Frequent Visitor

I got where I (thought) needed to be when I wrote the thing anyway;

I changed patch to
{Title: Office365Users.UserProfile(Concatenate("extra",BarcodeScanner1.Value,"extra")).DisplayName}

And it does exactly what I want now, albeit a bit slower than dropping the Raw value into the Sharepoint and letting a Flow do it on the backend. @ArchitectMadhan I will explore the FlowinApp bit now to see if it improves the refresh speed. I think your idea will let me backend the operation and speed up scanning.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,552)