cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mandy4514
Helper I
Helper I

Clear collect only active users on app load

On Start of App I have a concurrent code:

Concurrent(ClearCollect(AdminsCollection,Filter('Promo Contact List',Active=true).'E-Mail'), ClearCollect(FeeAdminsCollection,Filter('Promo Contact List',SeeFees=true).'E-Mail'), ClearCollect(colPromoRules, PromoOfficialRules))

The first two are to filter items down to only active equals true but the collection is still pulling all items, not just active items.  Any suggestions? 

1 ACCEPTED SOLUTION

Accepted Solutions
GarethPrisk
Resident Rockstar
Resident Rockstar

What is the Promo Contact List data source? CDS?

If so, offload this filtering to a view to ensure you're getting the correct results. Keep in mind that collect will be limited to delegation limits, in case you have more than 2000 records.

Also, if the attribute being checked is Boolean you can simply include it, no need to say = True/False.

Concurrent(ClearCollect(AdminsCollection,Filter('Promo Contact List',Active).'E-Mail'), ClearCollect(FeeAdminsCollection,Filter('Promo Contact List',SeeFees).'E-Mail'), ClearCollect(colPromoRules, PromoOfficialRules))

However, if they're CDS attributes, you'll need to do an explicit check based on the data type. Again, if its CDS, this is easily accomplished by developing a system view to offload the filtering criteria. Otherwise, let me know the data source type and the attributes and we can work on a filtering query.

View solution in original post

2 REPLIES 2
TesDA
Responsive Resident
Responsive Resident

Is it referencing a boolean in your dataset? If the dataset column is text/ string/ varchar/ nvarchar you may need to surround the true in quotes: "true"

 

Another possibility is that its case sensitive, IE is it True or true in your dataset?

GarethPrisk
Resident Rockstar
Resident Rockstar

What is the Promo Contact List data source? CDS?

If so, offload this filtering to a view to ensure you're getting the correct results. Keep in mind that collect will be limited to delegation limits, in case you have more than 2000 records.

Also, if the attribute being checked is Boolean you can simply include it, no need to say = True/False.

Concurrent(ClearCollect(AdminsCollection,Filter('Promo Contact List',Active).'E-Mail'), ClearCollect(FeeAdminsCollection,Filter('Promo Contact List',SeeFees).'E-Mail'), ClearCollect(colPromoRules, PromoOfficialRules))

However, if they're CDS attributes, you'll need to do an explicit check based on the data type. Again, if its CDS, this is easily accomplished by developing a system view to offload the filtering criteria. Otherwise, let me know the data source type and the attributes and we can work on a filtering query.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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