Skip to main content

Notifications

Community site session details

Community site session details

Session Id : jg3iLAuaYH+u8Qz9xJPVEX
Power Apps - Building Power Apps
Suggested answer

How do you use the Office365.Groups.HttpRequest(URI, Method, file)

Like (0) ShareShare
ReportReport
Posted on 18 Nov 2021 17:02:09 by 26

I would like to query Graph from PowerApps by providing a Group DisplayName or mailNickName.

 

Currently this works in Graph Explorer - https://graph.microsoft.com/v1.0/groups?$filter=mailNickname eq '<nickname>' but I can't find any documentation to use the Office365.Groups.HttpRequest("https://graph.microsoft.com/v1.0/groups?$filter=mailNickname eq '<nickname>'", "GET", file) to make it work.

 

What am I supposed to use for 'file'?

 

Where do I find information about how to structure the formula in PowerApps? I am trying to use instructions from this docs.microsoft.com page: Office 365 Groups - Connectors | Microsoft Docs

  • Suggested answer
    SaiRT14 Profile Picture
    1,966 Super User 2025 Season 1 on 13 Oct 2024 at 13:21:10
    How do you use the Office365.Groups.HttpRequest(URI, Method, file)
    You already have the correct URL for querying groups by mailNickname:
    https://graph.microsoft.com/v1.0/groups?$filter=mailNickname eq '<nickname>'
     
    PowerApps provides the Office365Groups.HttpRequest() function to make direct Graph API calls.
    Office365Groups.HttpRequest("Request URL", "Request Method", "Request Body")
     
    Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/groups?$filter=mailNickname eq '<nickname>'", "GET", "")
     
    Here are links
     
    Hope this helps.
  • dee2005 Profile Picture
    93 on 13 Oct 2024 at 07:07:18
    How do you use the Office365.Groups.HttpRequest(URI, Method, file)
    Hi, 
     
    Is there a way to pass the authentication details when calling a graph api in PowerApps?
    {
    "authority": "https://login.microsoft.com",
    "tenant": "xxx",
    "audience": "https://graph.microsoft.com",
    "clientId": "xxx",
    "secret": "xxx",
    "type": "ActiveDirectoryOAuth"
    }
  • MSProfessional Profile Picture
    3 on 03 Jan 2024 at 14:04:17
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    Use "" in place of file. If you provide nothing in a pair of double quotes it runs perfectly.

    Thanks!

  • Ondrix Profile Picture
    101 on 24 Nov 2023 at 10:04:53
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    Thanks, if i could i would mark you as right answer :D.

     

    Now i know what was my mystake. I asumed that result is JSON like in powerautomate or graph explorer and thanks to you now i understand it is just normal table format powerapps uses but columns are not specified which type they are.

    Ondrix_1-1700820235152.png

     

    Ondrix_0-1700820173972.png


    Once more thank you 🙂

  • johnxt Profile Picture
    87 on 23 Nov 2023 at 14:44:04
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    Oh and this page is well worth keeping handy if you're going to be doing a lot of messing about with untyped objects
    Untyped object data type - Power Platform | Microsoft Learn

  • johnxt Profile Picture
    87 on 23 Nov 2023 at 14:29:13
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    So I had a quick look, didn't have much luck trying to get a specific group, I ended up with 'network error' in my variable? But if I got ALL the groups, it worked... For a quick and dirty test I used a button to pull the data:

     

    Set(Var,Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/groups","GET",""))

     

     

    Then set the Items field in a combobox to:

     

    ForAll(Var.value, { FirstField: Value(ThisRecord.id), SecondField: Text(ThisRecord.onPremisesSamAccountName) })

     

     

    which populated it with the groups, you can play with it how you like from here hopefully 🙂

  • MRBCODC Profile Picture
    69 on 23 Nov 2023 at 13:48:13
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    The ParseJSON did not work for me either i believe this is a restriction with PowerApps and Untyped objects - I did look this up before but i cannot recall the reason why it does not work.

    I had the same issue, I used the users endpoint but i set the field i wanted to use as a variable to use it text as shown in the screenshot

     

    hope this helps

     

    MRBCODC_1-1700747147920.png

     

     

  • Ondrix Profile Picture
    101 on 23 Nov 2023 at 13:38:48
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    I m trying to get members from office365groups but i recieve this error and i can not force it into parseJSON since my result is not text type but object type and even forcing it by plaintext function does nothing.

    Ondrix_0-1700746588202.png

    Ondrix_1-1700746672260.png

    what could be wrong?

     

  • johnxt Profile Picture
    87 on 06 Oct 2023 at 12:35:43
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    good stuff 🙂 

  • LĂĽbbe Profile Picture
    27 on 05 Oct 2023 at 15:55:16
    Re: How do you use the Office365.Groups.HttpRequest(URI, Method, file)

    many, many thanks to "dotter" and "johnxt"!!! absolutly great 🙂 

    Now I can use the whole world of Graph-API, not only the GET-requests 🙂

     

    With "dotters" idea and with "johnxt"'s simplification it was really simple to create a small component with a function and one string-parameter: Give the function the string, which should be encoded, the function-returnvalue is the BASE64-encoded string.

     

    Then it's really easy to integrate the whole thing into PA, as you can see in the picture where I'm updating a listitem field called "Title" with a value that the user just entered:

     

    Lbbe_0-1696521046001.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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 110 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 75

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 52 Super User 2025 Season 1

Overall leaderboard