cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colonel_claypoo
Level: Powered On

How to filter results of an HTTP request?

Hi, I have an HTTP Graph request which gets all my Office 365 users. Now, I'd like to filter out those that don't have a specific email extension (.e.g. @contoso.onmicrosoft.com) since the HTTP request also returns users external to our tenant. So far I have used a Select action to select the display name and email address. But, how can I select only those objects which meet the email filter criteria? Thanks for your help.
3 REPLIES 3
Community Support Team
Community Support Team

Re: How to filter results of an HTTP request?

Hi @colonel_claypoo,

 

Please just take a try with the data operations –Filter array action.

Using this action could help reduce the number of objects in an array to a subset that matches the criteria you provide.

Here is the doc for your reference:

https://docs.microsoft.com/en-us/flow/data-operations#use-the-filter-array-action

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
colonel_claypoo
Level: Powered On

Re: How to filter results of an HTTP request?

Hi @v-yamao-msft,

 

thanks for your reply.

Unfortunately, the HTTP action returns an object and thus I can't get the filter action to work.

 

Doing:

chrome_2019-01-09_13-06-29.png

gives the following error:1.png

 

Changing the expression to @contains(body('HTTP')['value']['mail'], 'com')

 

I also tried putting the filter condition in the expression of the Select action but also to no avail:

 

chrome_2019-01-09_13-11-28.pngchrome_2019-01-09_13-09-30.png

 

There must be something I'm getting wrong that I'm not seeing.

Any ideas?

 

Thanks!

 

Highlighted
misterpower
Level: Powered On

Re: How to filter results of an HTTP request?

I ran into this topic while trying to find out how to filter HTTP REST requests in combination with Business Central. You can filter the results of your HTTP request by conforming to the API guidelines specified in the following documentation: https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md#97-filtering.

 

Your filter will look as below. In the query, use $filter as parameter instead of the fields. Your value will contain the complete REST filter string. 

 

HTTP1.png

When executed, it looks as following:

 

HTTP2.png

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,691)