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 / Fill dropdown using su...
Power Apps
Answered

Fill dropdown using subquery

(0) ShareShare
ReportReport
Posted on by 45

Hello,

 

Can someone help me with formula to bind dropdown? Below is the equivalent SQL

 

 

Select distinct Col1 from tbl1 where id in (Select tbl1Id from tbl2 where Col2=2)

 

Sample data & expected output:

nileshvk_0-1643298840834.png

 

 

 

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    https://docs.microsoft.com/en-US/powerapps/maker/canvas-apps/functions/function-distinct

     

    Use distinct to not repeat and filter the datasource to check where Col2=2

    Distinct( Filter( table1, col2 = 2), Col1)

     

    It must be something like that

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • nileshvk Profile Picture
    45 on at

    @Nogueira1306 I am struggling with below portion of SQL as it returns collection of values.

    (Select tbl1Id from tbl2 where Col2=2)

      I am looking for something like:

    Distinct( Filter( table1 in <collection of Values>), Col1)

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @nileshvk :

    I assume there are two tables:

    ClearCollect(tbl2,{id:1,Col2:1,tbl1Id:1},{id:2,Col2:2,tbl1Id:2},{id:3,Col2:2,tbl1Id:3},{id:4,Col2:3,tbl1Id:4},{id:5,Col2:3,tbl1Id:5});
    ClearCollect(tbl1,{id:1,Col1:"A"},{id:2,Col1:"B"},{id:3,Col1:"C"},{id:4,Col1:"D"},{id:5,Col1:"E"})

    Please use this formula to get the result:

    RenameColumns(
     Distinct(
     Filter(
     tbl1,
     id in Filter(
     tbl2,
     Col2 = 2
     ).id
     ),
     Col1
     ),
     "Result",
     "Col1"
    )

    Best Regards,

    Bof

     

  • nileshvk Profile Picture
    45 on at

    @v-bofeng-msft , How to eliminate Delegation warning for "in" operator? it says:

    "delegation warning: the highlighted part of this formula might not work correctly on large data sets"

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 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard