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 / Power Apps / Office365Groups.HttpRe...
Power Apps
Answered

Office365Groups.HttpRequest Formula

(0) ShareShare
ReportReport
Posted on by 505

Hello,

 

i am trying to get a List of all Groups in my Organization useing the O365Groups.HttpRequest action in a gallery.

 

I can read all groups on the Graph Explorer Website but which formula do i use to get the List into Powerapps?

 

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

is the code i can find.

 

Thank you for your help!

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @niklasjegg ,

     

    Currently, I haven't seen a case where someone has successfully used Office365Groups.HttpRequest in powerapps canvas.

    Some parameters are not explained in detail in the documentation so I suggest you use canvas to call flow and use flow to do this action.

    vxiaochenmsft_1-1643619862620.png

     

    Best Regards,

    Wearsky

     

     

  • niklasjegg Profile Picture
    505 on at

    Hello and thank you,

     

    i have figured out how to get the groups with graph.api 🙂 thank you!

  • pupdw Profile Picture
    13 on at

    Hi niklasjegg, I've come to the same issue of trying to get a list of groups using PowerApps Office365Groups connector and the HttpRequest control. You mentioned that you figured out how to get the groups with graph.api, can you expound on your solution? Did you use PowerApps Office365Groups connector?

     

    Thanks in advance for your help.

  • niklasjegg Profile Picture
    505 on at

    Hi @pupdw , no i did not use this connector. I have used the Graph Api and Built a Custom Connector.

    i have used this post on how to set it up and get it working and went far from there. Access Microsoft Graph API using Custom Connector in PowerApps and Flows | GoToGuy Blog


    What exactly are you trying to achieve? I am useing the Custom Connector to get all groups of my tenant and after many hours of testing i got it to work. if you need help with that i can get you there.

     

    BR

     

  • pupdw Profile Picture
    13 on at

    I want to get a list of all groups in my organization and make it accessible, in an app, for clean up - the app would not allow for changes to group membership but only see members of the group and make recommendations for removal or change.

     

    Thank you for sharing the link about how to create a custom connector in powerapps and flow. I will try it out.

     

    If I run into any problems or need help, I will definitely reach out.

     

    Thanks a bunch,

    DW

  • niklasjegg Profile Picture
    505 on at

    that is absolutely possible. You will run into an issue when you have more than 99 groups as they can only be displayed through  a "skiptoken" aka "odata.nextlink".

     

    If you have more than 999 groups you need another connector and if you thank have more than the next 999 you also need another connector because you cant use the same "get api command " twice in1  connector.

    //Page 1
    ClearCollect(CorpGroups,APIGroups.GetGroups({'$top': 999 }).value);
    Set(varSkiptoken,APIGroups.GetGroups({'$top': 999 }).'@odata.nextLink');
    
    //Page 2 Right(varSkiptoken,Len(varSkiptoken) -60)
    Collect(CorpGroups,APIGroupsPage2.GetPage2({'$skiptoken': Right(varSkiptoken,Len(varSkiptoken) -60) }).value);
    Set(varSkiptoken2,APIGroupsPage2.GetPage2({'$top': 999,'$skiptoken': Right(varSkiptoken,Len(varSkiptoken) -60) }).'@odata.nextLink');
    
    //Page 3 Right(varSkiptoken2,Len(varSkiptoken2) -60)
    Collect(CorpGroups,APIGroupsPage3.GetGroupsPage3({'$skiptoken': Right(varSkiptoken2,Len(varSkiptoken2 ) -60) }).value);
    //Set(varSkiptoken3,APIGroupsPage3.GetGroupsPage3({'$top': 999,'$skiptoken': Skiptoken_1.Text }).'@odata.nextLink');

    you need to send the correct link to the API thats why i am getting rid of the https://.... with the length function.

     

     

     i am useing this graph api command 

    https://graph.microsoft.com/v1.0/groups

    with an extra query for $top   and $Skiptoken

  • alokbgs Profile Picture
    12 on at

    Can you  @niklasjegg please provide solution step by step how to achieve it ?

  • niklasjegg Profile Picture
    505 on at

    sorry for the late reply @alokbgs  where do you have problems?

  • santy2 Profile Picture
    15 on at

    Hi @niklasjegg @v-xiaochen-msft ,

     

    In order to use those .HttpRequest() functions from Office365Groups and Office365Users - you would need to specify the xml schema for the response you are expecting from the request . This would require unpacking the app using the Power Platform tools on vs code , modifying the Office365Groups.xml file and packing it back .

     

    1. Unpack the app with the Power Platform tools (https://www.youtube.com/watch?v=vsd2WuNx_Cg&t=715s)
    2. Find the Wadl folder (pkgs/Wadl) and then open the Office365Groups.xml file.
    3. Specify the xml schema for the response expected      
    Let's say this is the response you get from requesting https://graph.microsoft.com/v1.0/groups on the Microsoft graph explorer
     
    {
         "value": [
            {
                 "renewedDateTime": "2018-04-05T16:19:06Z"   
            }
        ]
    }

    So inside <gramars><jsonTypes> tags in the Office365Groups.xml file, you would add the following:

    <object name="fields_def">
          <property name="renewedDateTime" type="string" />
    </object>
      <array typeRef="fields_def" name="value_def" />
     <object name="BodyResponse">
        <property name="value" typeRef="value_def" />
    </object>
    santy2_0-1671160571554.png

     

    4. Add a response tag inside the HttpRequestV2 function() to connect the response schema you created with the function . So now it can map the response value to the renewedDateTime property
    <response>
              <representation mediaType="application/json" element="service:BodyResponse" />
     </response>
     
    santy2_1-1671160862786.png

     

     5. Pack the app using the Power Platform tools (please refer to the video) and upload it
     6. Now on the canvas editor you will see that you got intellisense for renewedDateTime and that the response from HttpRequestV2 function() maps the values
    santy2_2-1671161162962.png

     

    Regards,

  • v-xiaochen-msft Profile Picture
    on at

    Hi @santy2 ,

     

    Thanks for your sharing. That's cool.

     

    Best Regards,

    Wearsky

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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard