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 Collection base...
Power Apps
Answered

Filter Collection based on specific ID from a SharePoint List

(0) ShareShare
ReportReport
Posted on by 798

Trying to create a collections based on a specific field value 

Galdcp selects a specific record from  a SharePoint list 

I want to create a collection from a "child" SharePoint list that has Galdcp ID as one of its field values. looks like I'm referencing the ID correctly but the Goal filed is bulling in all the rows, not just the one for the selected ID. What am I missing?

 

ClearCollect(colfaitems,KYOJDCPFocusAreas;{DCP:galdcp.Selected.ID,Goal:KYOJDCPFocusAreas.Goal});

 

ctedesco3307_0-1681846169967.png

 

ctedesco3307_1-1681846206437.png

 

All I should be getting are the bottom 3 

 

ctedesco3307_2-1681846293467.png

 

 

Thx 

Categories:
I have the same question (0)
  • JohnM86 Profile Picture
    590 on at

     

    It looks like you are using the semicolon (;) to separate the two arguments of the ClearCollect function, which is causing the second argument ({DCP:galdcp.Selected.ID,Goal:KYOJDCPFocusAreas.Goal}) to be interpreted as a separate statement instead of an additional record to include in the collection.

    To fix this, you can use the comma (,) instead to separate the two arguments, and then use the Filter function to retrieve only the items from the child SharePoint list that have the selected Galdcp ID:

     

    ClearCollect( colfaitems, Filter( KYOJDCPFocusAreas, DCP = galdcp.Selected.ID ) );
     

    This should create a collection called "colfaitems" that includes all items from the "KYOJDCPFocusAreas" SharePoint list where the "DCP" field matches the ID of the selected item in the "galdcp" gallery. The "Goal" field of each item should be included in the collection as well.

  • ctedesco3307 Profile Picture
    798 on at

    @JohnM86 Thanks - closer - but now I get an error at the = sign  - Incompatible types  for comparison These values can't be compared Record number 

     

    DCP in KYOJDCPFocusAreas is a lookup field.  I'll mess around with it a bit. thx 

    ClearCollect(colfaitems,Filter(KYOJDCPFocusAreas, DCP = galdcp.Selected.ID));

  • JohnM86 Profile Picture
    590 on at

     

    To fix this issue, you could try using the Value function to get the underlying value of the lookup field. Here's an example of how you could modify your formula to do this:

     

     
    ClearCollect(colfaitems, Filter(KYOJDCPFocusAreas, Value(DCP) = Value(galdcp.Selected.ID)))
     

    The Value function returns the underlying value of the lookup field, which should allow you to compare the two values without any issues.

  • Verified answer
    BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @ctedesco3307 ,

     

    Instead of using the Value function, select the Value column for the DCP record:

     

    ClearCollect(colfaitems,Filter(KYOJDCPFocusAreas, DCP.Value = galdcp.Selected.ID));
  • ctedesco3307 Profile Picture
    798 on at

    @BCBuizer - that worked!  Thank you 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard