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 1 table based o...
Power Apps
Unanswered

filter 1 table based on other table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I'm trying to populate a combobox with values from 1 table, filtered on the condition that they are present in a different table
this is a simplified view of my database: https://i.imgur.com/9MlYefY.png
I am trying to display the name field of the addresses table, but only for the ones which codes are present in one of those 3 columns in the planning table

I have tried using this filter:

Filter('[dbo].[BIT_Addresses]',code in(('[dbo].[BIT_Planning]').'Load./disch.') Or code in('[dbo].[BIT_Planning]'.To) Or code in('[dbo].[BIT_Planning]'.From)).name

but that is not giving me all of the names

I've also tried using a flow which executes an SQL query, but I can also not get that result to show in a dropdown menu, this is an example of the json the query returns: https://pastebin.com/UiJbQk53

any advice on how I can get the filter to work or how to get the SQL results to show up in my combo box would be greatly appreciated 🙂

- Annie

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your issue?

    Do you mean that you could not get all available values within the ComboBox?

     

    Based on the formula that you provided, I could not find any syntax error with it. Please modify your formula as below:

    Filter(
    '[dbo].[BIT_Addresses]',
    code in '[dbo].[BIT_Planning]'.'Load./disch.' || code in '[dbo].[BIT_Planning]'.To || code in '[dbo].[BIT_Planning]'.From
    ).name

    then check if the issue is solved.

     

    In addition, please also take a try to save your two SQL Tables records into two separated collections, then use the Collections as data source within your app instead of Original SQL Tables. Please take a try with the following workaround:

    Set the OnStart property of the App control or set the OnVisible property of the first screen of your app to following:

    ClearCollect(
      PlanningCollection,
     '[dbo].[BIT_Planning]'
    );
    ClearCollect(
    AddressCollection,
    '[dbo].[BIT_Addresses]'
    );

    Then modify your formula as below:

    Filter(
     AddressCollection,
     code in PlanningCollection.'Load./disch.' || code in PlanningCollection.To || code in PlanningCollection.From
    ).name

    please take a try with above formula, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xida-msft 

    it was indeed not showing all available values in the combobox, it only showed 4 but there should've been 38 options. Even weirder, when I change isSearchable to true, it's not showing anything. 

    I tried both your suggestions, unfortunately, they both did not work. The first filter had the same result with only showing 4 results, and the second suggestion showed none. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @v-xida-msft,
    do you have anything else I could try?  😕 

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard