web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / virtual agent find use...
Copilot Studio
Answered

virtual agent find user informaton from userid

(0) ShareShare
ReportReport
Posted on by 35

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?

Categories:
I have the same question (0)
  • Gianmaria85 Profile Picture
    35 on at

    Ok the second problem was that i was writing in the variable 'send_an_HTTP_request' but the program was set in italian lenguages.

    Thank you Expiscornovus for the help anche patience! 

  • Gianmaria85 Profile Picture
    35 on at

    i'm a stupid, you are perfectly right were the spaces that generated the error!!now i have another problem with the following variable this is the error that generates me:

    please correct to include a valid reference to 'send_an_http_request' for action imput parameters. 'set veriable'

     

     

  • Expiscornovus Profile Picture
    33,417 Most Valuable Professional on at

    Hi @Gianmaria85,

     

    That is exactly what I suggested 😉

     

    Only difference is the beta endpoint instead of v1.0 one and I escaped the ? character with a slash.

     

    Btw, in your previous screenshot it looked like the Uri value ended with a lot of unnecessary space characters. That might be the reason it did not work.

  • Gianmaria85 Profile Picture
    35 on at

    i think i found the solution....in graph explorer i create a request like this:

    https://graph.microsoft.com/beta/users/?$filter=onPremisesSamAccountName eq '(badge)'&$count=true

    and the system return all the user information to me!!!now i try to insert it into the flow

  • Gianmaria85 Profile Picture
    35 on at

    sure

     

    1.jpg2.jpg

     

     

     

  • Expiscornovus Profile Picture
    33,417 Most Valuable Professional on at

    Hi @Gianmaria85,

     

    Can you share a screenshot of your current configuration/flow setup?

  • Gianmaria85 Profile Picture
    35 on at

    Sorry, in the search field the office 365 group he didn't let me find it.

    Anyway, i corrected the flow but it gives me this error:

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
    <HTML><HEAD><TITLE>Bad Request</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
    <BODY><h2>Bad Request - Invalid Hostname</h2>
    <hr><p>HTTP Error 400. The request hostname is invalid.</p>
    </BODY></HTML>

  • Expiscornovus Profile Picture
    33,417 Most Valuable Professional on at

    Hi @Gianmaria85,

     

    1. There are different Send an HTTP request actions. Can you double check you the same connector and action like in my example? 

     

    o365groups.png

    2. Did you also add the 'ConsistencyLevel: eventual' header in the CustomHeader1 field?

     

    header_level.png

  • Gianmaria85 Profile Picture
    35 on at

    the send http request return an error when i use the flow:

    {
      "error": {
        "code"400,
        "message""URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector. Resources: me,users Objects: messages,mailFolders,events,calendar,calendars,outlook,inferenceClassification. Uri: https://graph.microsoft.com/v1.0/users/?$filter=onPremisesSamAccountName eq 'i219366'&$count=true",
        "source""flow-apim-europe-001-westeurope-01.azure-apim.net",
        "path""choose[6]\\when[1]",
        "policyId""",
        "clientRequestId""6866ebf6-9d32-48b8-ae5c-de98accbba3f"
      }
  • Verified answer
    Expiscornovus Profile Picture
    33,417 Most Valuable Professional on at

    Hi @Gianmaria85,

     

    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']

     

     

    onpremisessamaccountname_filter.png

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 401

#2
chiaraalina Profile Picture

chiaraalina 126

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 90 Super User 2025 Season 2

Last 30 days Overall leaderboard