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
Super User II
Super User II

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
Super User II
Super User II

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,341)