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 Apps / ComboBox Field to show...
Power Apps
Unanswered

ComboBox Field to show only Users of a specific country which obtain data from SharePoint column

(0) ShareShare
ReportReport
Posted on by 86

Hi, 

I am new to PowerApp & I have a field that obtained data from the SharePoint column with “Choose from: All Users”.

How do I apply a filter to the ComboBox so that it only shows users from a specific country? Thanks.

 

tanst_844288_2-1644211704934.png

 

 

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    In your SharePoint list is there a column that defines the country the employees are in?

  • tanst_844288 Profile Picture
    86 on at

    No, my SharePoint only has the column for

    - Visitor Name

    - Visitor Email & phone number

    - Employee (the employees the visitor wanted to visit) which obtain data from All Users

    tanst_844288_0-1644295088068.png

     

    I know that the All Users has information for Name, Email, Department & etc but unsure if it has Country also or if I can add this info into the record.

    Sorry, if I sound ignorant about the All Users because most information I found online is very sketchy regarding this part- it only mentions that it fetches from the active directory (whatever it means).

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @tanst_844288 ,

     

    Unfortunately, the answer is no. The person column doesn't have a Country property.

    But you could use Office365Users connector to get their countries.

    AddColumns(LIST214,"Test_Country",Office365Users.SearchUser({searchTerm:ThisRecord.Test_Person.Email}).Country)

    //LIST214 is the name of my list. Test_Person is the person column .

     

    In other words, you could get the country by using the unique email .

     

    Then you could use Distinct function to get unique countries array.

    But before that, you should make sure to set each user's country information.

    Their information is stored in azure AD.

     

    Best Regards,

    Wearsky

  • tanst_844288 Profile Picture
    86 on at

    Hi Wearsky, I think of using your first suggestion. But where & how do I put in the formula for the first method you suggested? Thanks

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @tanst_844288 ,

     

    It can be used in many places, such as the items property of gallery.

     

    Best Regards,

    Wearsky

  • tanst_844288 Profile Picture
    86 on at

    I don't have a gallery for the employee, so I added the formula to the dropdown ComboBox under property "Items". But I have 2 errors when putting in the formula, is there other things I have to fix before the formula works?

    tanst_844288_0-1644401032026.png

    I guess I need to put in another formula to filter the country that I wanted

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @tanst_844288 ,

     

    OK,I didn't notice that your person column allows multiple selection.

    I'm a little confused. What the scope do you want to filter users by country?

    In other words, if you want to filter users in the US, is the scope the users of the entire organization (tenants) or the users that exist in the sharepoint list person column?

     

    Best Regards,

    Wearsky

     

  • tanst_844288 Profile Picture
    86 on at

    I worked in a multinational organization, the All Users has employees in many different countries but I just want to filter the employees to the country I reside

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @tanst_844288 ,

     

    Office365Users connector will return Country field.

    https://docs.microsoft.com/zh-cn/connectors/office365users/#search-for-users-(v2)

    vxiaochenmsft_0-1644457828445.png

     

    Best Regards,

    Wearsky

     

  • tanst_844288 Profile Picture
    86 on at

    Hi Wearsky, Thanks, actually I am trying to use the formula you given which I have errors currently. 

    I am trying to elaborate the outcome that I am looking for below - I don't know if this is possible.

    tanst_844288_0-1644461042725.png

     

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 Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard