Announcements
hello everybody. i need some help.
I want to find person information (name/email) of my organization when i type to my bot the user id of this person.
how can i do?
Hi @Gianmaria85,
You could use a flow for this. In that flow you can use the get user profile (v2) action to try and find the user based on userid.
Below is an example setup
1. The cloud flow setup.
In this setup I have configured the configure run after setting of the condition action. It also runs when it has failed. This is to make sure we can output the No user found in the If No branche.
2. The PVA topic which uses that flow and show the output in a message to the user interacting with the bot.
I'm sorry if i only answer now... I try but the flow generate the error user not found. i am attaching the screenshot of the error. In microsoft list i can find a user's data starting from the userid, here no.. Any suggestions?
A Get user profile (v2) action expects a user principal name or a user id. Although you blurred that value in the screenshot it does not look it is either a UPN or user id value. Can you double check that?
It looks like you are searching with something else, what did you use. The samAccountName or the displayname of a user?
In your opening post you mentioned that you wanted to use the user id of the user. So, could you clarify what you actually want use to search?
Hi Expiscornovus,
thank you for your patience. I'm using the badge number ixxxxxx becouse in microsoft list this number can find the user associated.
So i need to find a way to get the userid by putting the number of badges as imput. i don't understend how microsoft list can find the users with the badge number.
i just checked and even in microsoft teams i can search users with the badge number...
The approach I suggested was based on the requirement that you wanted to use the user id.
I simply need to re-design the flow, because you want to use the badge column instead. The flow I shared earlier will not work with this other field. It will always output user not found.
Just to double check, which field in Azure Active Directory/User profile have you used to store the badge number?
i don't sure that i undurstand what do you want...if i go in azure/user profile the badge numbers is in three field.
i attach the screenshot where i obscured the data not knowing which ones are sensitive to the company where i work.
Thanks for sharing, that is really useful 👍
To clarify, searching and finding people via a people picker in a SharePoint Online list/library column works different compared to retrieving that same profile information in a flow.
So, unfortunately your request is not as straightforward as it looks in the SharePoint list.
That's why I am trying to find the correct approach for the information you are trying to retrieve via the Power Virtual Agent and the connected cloud flow. Hopefully that makes sense?
I think you can use a List users method of the Graph API for the search in instead. Use a $filter query parameter on onPremisesSamAccountName which you are using to store the badge number.
Below is an example
1. In the Send an HTTP request action (Office 365 Groups connector) use the following URI
https://graph.microsoft.com/v1.0/users/?$filter=onPremisesSamAccountName eq '@{triggerBody()['text']}'&$count=true
Also make sure you add the ConsistencyLevel: eventual header as well.
2. In the condition check if the length of the response is greater than 0. This means it has found users.
length(body('Send_an_HTTP_request')['value'])
3. In the set variable use the expression below to retrieve the displayName and mail of the first user match
first(body('Send_an_HTTP_request')['value'])['displayName']
first(body('Send_an_HTTP_request')['value'])['mail']
the send http request return an error when i use the flow:
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 410
Romain The Low-Code... 160 Super User 2026 Season 1
chiaraalina 63 Super User 2026 Season 1