cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Collect(Collection,'Entity') fails to write content of lookup fields

I have a LARGE entity, 25,000 records, which means I easily hit the delegation limit in formulas. I am attempting to filter the entity not only by the field "name" but also by its lookup field "state." Being a lookup field, I get the two blue lines (delegation warning) if I try to use it in a filter.

Soooo, I have created a collection using the OnVisible property:

 

Collect(Collection,'CDS Entity')

 

This almost works. The problem is that it fails to collect data from columns that contain lookup values... (this seems to be a broken function in PowerApps).

Is there a way either:

1) to create a collection from my 25,000 records (which contains text in the lookup columns) from the CDS entity it is created from (i.e. that I can then reference in a filter formula)? or,

2) to filter a 25,000 record long entity by a) it's (text) name, as well as b) a lookup field?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Collect(Collection,'Entity') fails to write content of lookup fields

Fair enough. My bad for overlooking that crucial part.

Not being in front of a computer, I wanted to check if you have had a chance to try something like this:

Filter('CDS Entity', Name = TextInput1.Text, LookupField.Title = TextInput2.Text)

Basic idea I want to try is to reference a particular column of the lookup field and compare it with text or a dropdown (whatever you have for the lookup field for the user to use to filter).

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Collect(Collection,'Entity') fails to write content of lookup fields

You have to force a collection to download lookup data. You can use AddColumns and DropColumns together for that.

For example,
Collect
(
Collection,
DropColumns
(
AddColumns
(
'CDS Entity',
"TempLookupColumn1",
LookupColumn1.Field
),
"TempLookupColumn1"
)
)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
Highlighted
Advocate II
Advocate II

Re: Collect(Collection,'Entity') fails to write content of lookup fields

Hi @PowerAddict 

Thanks so much for your reply. Sadly AddColumns and DropColumns are both subject to the non-delegation limit.

I am hoping to collect all 25,000 records (if possible)... or find some other workaround, but the goal is filtering all 25,000 records both by the name field (text) as well as the state field (lookup column).

Highlighted
Super User
Super User

Re: Collect(Collection,'Entity') fails to write content of lookup fields

Fair enough. My bad for overlooking that crucial part.

Not being in front of a computer, I wanted to check if you have had a chance to try something like this:

Filter('CDS Entity', Name = TextInput1.Text, LookupField.Title = TextInput2.Text)

Basic idea I want to try is to reference a particular column of the lookup field and compare it with text or a dropdown (whatever you have for the lookup field for the user to use to filter).

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Collect(Collection,'Entity') fails to write content of lookup fields

thx again @PowerAddict 

That's perfect! A little adaptation & it's up and working. I wonder why it called the delegation error before?

Highlighted
Super User
Super User

Re: Collect(Collection,'Entity') fails to write content of lookup fields

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,374)