Featured image of post Using Graph API Calls to the Search Endpoint in PowerApps

Using Graph API Calls to the Search Endpoint in PowerApps

Learn how to use Graph API calls in PowerApps to enhance your apps.

Pre-requisites

  1. Activate the “ParseJSON function and untyped objects” preview feature in PowerApps settings.
  2. Add the Office365Groups connector to your PowerApps.

Using Office365Groups.HttpRequest

Use Office365Groups.HttpRequest to make HTTP requests to external services in PowerApps.

Example:

1
Set(varRequestBody,"{""requests"": [{""entityTypes"": [""message""], ""query"": {""queryString"": ""subject:Hello""}}]}");
1
Set(varResult, Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/search/query", "POST", varFile))

Display the search results in a gallery control.

Example:

1
Table(Index(Table(Index(Table(varResult.value),1).Value.hitsContainers),1).Value.hits)
1
ThisItem.Value.resource.subject

Conclusion

Learn how to use Graph API calls in PowerApps to enhance your apps. blog post, I’ve shown you how to use Graph API calls to Microsoft Search in PowerApps by using the Office365Groups.HttpRequest and the preview feature “ParseJSON function and untyped objects”. By following these steps, you’ll be able to retrieve data from external sources and use it within your PowerApps. We hope you found this post helpful! Let me know if you have any questions or comments.

Additional Resources

  1. Some links to more information about Microsoft Search and the Graph API:

  2. For testing / creating search queries:

    • SharePoint Search Query Tool - https://github.com/pnp/PnP-Tools (Windows only)
    • SP-Editor - Search Microsoft Edge Add-ons for it in the future as the Search part isn’t yet implemented in the meantime get the old Add-on from the Chrome Web Store (Windows, Mac, Linux)

Comments

You can use your Mastodon account to reply to this post. Learn how this is implemented here.

Reply to ollimenzel's post

With an account on the Fediverse or Mastodon, you can respond to this post. Since Mastodon is decentralized, you can use your existing account hosted by another Mastodon server or compatible platform if you don't have an account on this one.

Copy and paste this URL into the search field of your favourite Fediverse app or the web interface of your Mastodon server.