web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to filter by Of...
Power Automate
Suggested Answer

Trying to filter by Office Location

(1) ShareShare
ReportReport
Posted on by 206
Hello,
 
I am having an issue with a flow and hope someone can see what I'm doing wrong.  Please see the flow below.  Using the office location as a filter in the "Send an HTTP Request" activity will not work (that parameter doesn't seem to be supported as a filter), so what I'm trying to do is pull back a list of users and then filter the results based on an office location value, which I'll return to Power Apps:
 
 
 
The flow runs successfully but the Filter Array activity always returns null results - in the example below, you can see at least one of the inputs has the Office Location value set to 1234
 
 
What could I be doing wrong? I've attached the json sample used in the parse activity.
 
(Also, SearchUserV2 won't work in this instance because initially, there will be more than 1000 users returned.  Post filter, I anticipate returning no more than 100 user names back to the Power App.)
Categories:
I have the same question (0)
  • AnthonyAmador Profile Picture
    2,557 Moderator on at
    Hi, 
     
    This is likely a problem with the schema, but it’s hard to identify where. Can you try with this schema I processed using your sample?
     
    {
        "type": "object",
        "properties": {
            "type": {
                "type": "string"
            },
            "properties": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "items": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string"
                                    },
                                    "properties": {
                                        "type": "object",
                                        "properties": {
                                            "businessPhones": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            },
                                            "displayName": {
                                                "type": "string"
                                            },
                                            "givenName": {
                                                "type": "string"
                                            },
                                            "jobTitle": {
                                                "type": "string"
                                            },
                                            "mail": {
                                                "type": "string"
                                            },
                                            "mobilePhone": {
                                                "type": "string"
                                            },
                                            "officeLocation": {
                                                "type": "string"
                                            },
                                            "preferredLanguage": {
                                                "type": "string"
                                            },
                                            "surname": {
                                                "type": "string"
                                            },
                                            "userPrincipalName": {
                                                "type": "string"
                                            },
                                            "id": {
                                                "type": "string"
                                            }
                                        },
                                        "required": ["businessPhones", "displayName", "givenName", "jobTitle", "mail", "mobilePhone", "officeLocation", "preferredLanguage", "surname", "userPrincipalName", "id"]
                                    }
                                }
                            }
                        }
                    },
                    "@@odata.context": {
                        "type": "string"
                    }
                }
            }
        }
    }
    

    Let me know if that works. 
    Anthony. 
     
    If my reply answers your question, please like and mark it as verified. This helps me stay motivated to assist others and makes it easier for users with similar questions to find the answer. Thanks!
    Feel free to connect with me on LinkedIn!
     

     
     
  • Suggested answer
    David_MA Profile Picture
    14,499 Super User 2026 Season 1 on at
    In your array, the officeLocation is a string. However, the filter is treating it as an integer. You should convert the dynamic value in the filter to an int and I think it should work. 
  • blanghorst Profile Picture
    206 on at
    Thanks for the help guys.
     
    @AnthonyAmador - this did not fix the issue.  I am pretty sure it is something with the JSON though like you said.
     
    @David_MA - officeLocation should be a string - I just put 1234 in the filter field because I have a profile with that office number and wanted to test if it would work.  I've also tried using other parameters such as givenName and it isn't working either.
  • AnthonyAmador Profile Picture
    2,557 Moderator on at
    Can you declare the following expression with the 1234 or dynamic value you are using? What @David_Ma mentioned makes sense, and it seems like the filter is interpreting the number as an integer.

    For example 



    Hope this helps. 
    Anthony. 
  • blanghorst Profile Picture
    206 on at
    Thanks!  Yeah, I went back and ran some tests.  Here's why I was a bit confused.  If I used ABC123 as the office location, it did not work either.  But I did go in this morning with a string function and it did work.  Interesting.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard