cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LinnZawWin
Kudo Kingpin
Kudo Kingpin

Using the ClearCollect() Function in PowerApps does not Pull any Lookup Columns from Common Data Service (CDS) Data Source

When I Collect from CDS Data Source into Collection in canvas app designer, the lookup fields are not being populated even though I can see the lookup values when I bind the data source to the data table.
This is the sample formula that I used

ClearCollect(ContactCollection, ShowColumns(Contacts, "fullname", "createdby"))

And this is the output collection without any data in the lookup column.

Empty%2BCollection

Sometimes, the lookup columns show up and most of the times, they do not.

Is that a bug? And is there any fix/workaround solution for it?

12 REPLIES 12

If I need to display data from a related entity, I usually do a lookup.

 

for example:

Entity1 is parent

Entity2 is child

Let’s say Gallery1 lists Entity2 child records, and I have some controls outside the gallery that need to display information from the selected record.  The information might need to be columns from the Entity2 record as well as its parent Entity1 record.

 

On select of the Gallery, I would set a variable for the selected record. Something like this:

 

Set(varRecord, Lookup([@Entity2], Entity2Id = Gallery1.Selected.Entity2Id)

 

Set(varParentRecord, Lookup([@Entity1], Entity1Id = varRecord.Entity2FieldName.Entity1Id)

 

That gives me 2 record variables to work with.

 

I usually also wrap those variable lookups with ShowColumns so that I can get the specific fields for the record that I want to work with. So, if there is a label or other control that needs to reference the column, I just make sure it’s included in the ShowColumns formula.

 

View solution in original post

SweetMaddin
Helper I
Helper I

Running in the same problem.

ClearCollect(SearchMonthDates,ShowColumns(AllMonthDates,"January"))

This simple example, used in many Posts here as "Function" is still NOT function and a BUG.
In my case the Collection SearchMonthDates is created BUT no Data is inside.
When using the development environment the correct result is confirmed, but in the App not running.

I saw the bug exist already since over one year, sadly and poor behaviour ...

@SweetMaddin  Is the value from "January" column referenced anywhere in your app? It is by design in Power Apps canvas app to retrieve the value which is used in the app.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,167)