cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colonel_claypoo
Advocate II
Advocate II

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
v-yamao-msft
Community Support
Community Support

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.

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!

 

misterpower
Advocate I
Advocate I

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,365)