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 / Collection includes ta...
Power Apps
Unanswered

Collection includes table, only want certain columns

(0) ShareShare
ReportReport
Posted on by 20

I have a SharePoint list of Projects that has a lookup column for the Client.  I am trying to get a Collection of all the Clients that are included in at least one Project.

 

I added the following function to the App OnStart event:

ClearCollect(collProjectClients, Distinct(Filter(ShowColumns(Projects, "Client", "Active"), Active=true), Client))

 

The Client being returned is a table (because it is a lookup field).  Right now, this is returning one row -- I believe because it doesn't look at the Client table.  Is there any way to bring in individual fields from the Client lookup, instead of the whole table?  I tried:

 

ClearCollect(collProjectClients, Distinct(Filter(ShowColumns(Projects, "Client.ID", "Client.Title", "Active"), Active=true) ,Client.ID))

 

But it doesn't recognize the Client.ID and Client.Title so doesn't run.  I also tried:

 

ClearCollect(collProjectClients, Distinct(Filter(ShowColumns(Projects, ShowColumns(Client, "ID", "Title"), "Active"), Active=true), Client)) but this doesn't work, either.

Categories:
  • VTBob Profile Picture
    20 on at

    I tried Ungroup, but it doesn't seem to work on these tables.

     

    ClearCollect(collProjectClients, Ungroup(ShowColumns(Filter(ShowColumns(Projects, "Client", "Active"), Active = true), "Client"), "Client"))

     

    Even with the Ungroup, the collection still returns a column titled "Client" with tables.  Completely stuck, and tips would be great!

  • PytByt Profile Picture
    943 on at

    Hi @VTBob 

    I'm new here.. 

    But, when i read your post title.. i thought about using AddColumn and ShowColumn Function. Have you tried it? 

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

    BR,

    pytbyt

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard