PowerApps - Filter Combo box control based on another table

Overview:

  • I have two tables
    • TableA (Columns: ProjectId, ProjectName, Project (GUID))
    • TableB (Columns: ResourceName, TableA.Project)
  • TableA has one-many relationship with TableB or TableB has many-one relationship with TableA.
  • Below are some sample data:


Use case:
  • In "Start screen", I have combo box control and I need to display all the Projects where the current logged in user is part of  it. 
  • The combo box control should display Project Id and ProjectName columns. To do that, 
    • Set Layout as Double
    • Set the Primary text to ProjectId column
    • Set the Secondary text to ProjectName column
    • If you have set IsSearchable to true then select the SearchField based on your need. Here I'm going to search based on ProjectId column
    • Write the below code in OnVisible property of "Start screen":
    • Write the below code in Items property of Combo box control:
    Result:
  • Consider the same data, 
    • If the current logged user is "John" then Combo box control will list the "AAA", "CSX" projects.
    • If the current logged user is "Andrew" then Combo box control will list only "AAA" project.
    

Comments

Popular posts from this blog

PowerApps - Work around for "OnChange event is triggered automatically when navigate to different records in Gallery"

PowerApps - Existing Date picker component - Current month date is not selectable