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 / Filter Display / Edit ...
Power Apps
Unanswered

Filter Display / Edit screen based on selected value from dropdown

(0) ShareShare
ReportReport
Posted on by 16

Hi

I have a powerapps app built from a Sharepoint list. Some of my fields are Staff no, Staff name, Position, Location & Country etc.,

 

I have dropdowns for Location & Country

 

I want to limit the display & edit screens only those users, based on the selected value of the Country dropdown. For eg- if the country dropdown is US, the user should only be allowed to view / edit those records where the Country=US. Same for Belgium, Sweden, Brazil, Mexico etc.,

 

Can someone please guide me on how to achieve this in Powerapps.

 

Thank you in advance.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Am assuming you have a users table which contain the Country column:

     Do a lookup in a default of textbox1:
     LookUp(TableName,EmailColumn=User().Email,Country)

     

    In the DefaultMode of your form put:

     If(Dropdown.Selected.Value=textbox1.Text,DisplayMode.Edit,DisplayMode.New)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.


       

     

     

  • saialkesh Profile Picture
    16 on at

    Hi

    Thank you for the prompt reply. My apologies, i was not detailed in my earlier post.

     

    I have Location as a dropdown in my SharePoint list, which is also a dropdown in PowerApps. I do have a users table, where i have user name, Email address and Location column. I have mapped the authorized user to its location.

     

    I have records that relate to location in the list.

     

    For users who are authorized to do edit the changes in PowerApps, i want the records to be filtered based on their assigned Location in the Users table. For eg: if i have 10 records out of 15 where the Location is Belgium, then i want only these 10 records to be made available to the user who is in my users table, with the location = Belgium

     

    Appreciate your guidance.

  • eka24 Profile Picture
    20,925 on at

    Have you tried my reply and what is the feedback.

  • saialkesh Profile Picture
    16 on at

    Hello Eka

     

    Yes, i tried and it didnt work. I did the following:

     

    on the location field, at Default entered the following lookup function

    Lookup(Tablename,Email=User().Email,location)

     

    On the form d

    DefaultMode, entered the following

    If(Dropdown.Selected.Value=Location.Text,DisplayMode.Edit,DisplayMode.New)

     

    Please do let me know, if i have done something wrong here

     

    Regards,

  • eka24 Profile Picture
    20,925 on at

    In

    Lookup(Tablename,Email=User().Email,location)

    What is the Actual name of your table or datasource, did you replace it.

     

    Is Location a textbox name on your screen?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • saialkesh Profile Picture
    16 on at
    Hello eka

    Table name is usertable and I substitute the same in lookup function.

    Location is a field name in my screen, which has the drop down


    Regards
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @saialkesh ,

    Whether do you want to filter records based on selected location in the drop down or

                                            filter records based on current user's location in usertable?

    1)filter records based on selected location in the drop down

    set the drop down's Items:

    Distinct(usertable,'Location & Country')

    set the gallery's Items:

    Filter(usertable,'Location & Country'=DropDown1.Selected.Result)

    Then set the display form/edit form's Item to Gallery1.Selected

    You will only view/edit records based on the location that you select in the drop down.

     

    2) filter records based on current user's location in usertable

    In this situation, you do not need a drop down to select location.

    You just need to filter based on current user's location.

    set the gallery's Items:

    Filter(usertable,'Location & Country'=LookUp(username,Email=User().Email,'Location & Country'))

    Then set the display form/edit form's Item to Gallery1.Selected

    You will only view/edit records based on the location that current user belongs to.

     

    If the tablename, fields name are not same as yours, please replace them with yours.

     

     

    Best regards,

  • saialkesh Profile Picture
    16 on at

    @v-yutliu-msft 

     

     

     

     

     

     

     

     

  • eka24 Profile Picture
    20,925 on at

    Please can you give a screen shot. 

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard