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

filtering a collection on an empty date impossible

I have loaded some records based on a search name into a collection and let this be the items of a gallery.

 

ClearCollect(ZoekDieren;SortByColumns(Filter('[dbo].[dier]_1';naam = eZoekTekst.Text);"identificatie_nummer_asiel";Descending))

This goes fine.

Now I want to filter this collection further by looking up a date in another tasble and only show when this dat is empty:

 

ClearCollect(ZoekDieren;Filter(ZoekDieren;Day(LookUp('[dbo].[asiel_verblijf]';dier_id=dier_id;vertrek_datum))=0))

The name dier_id is the same for the table from the first code (and thus the collection) and fot the target table '[dbo].[asiel_verblijf]', that is way dier_id=dier_id.

Should I disambiguate this and how?
Setting the filter to isblank(vertrek_datum) of vertrek_datum=0 doesn't help at all.

If I say vertrek_datum>0 I get all records so there is not some deep fundamental flaw to the approach I would say.

 

Working with values being blank and especially dates is a real pita in powerapps imho. Costs a lot of time. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: filtering a collection on an empty date impossible

Hi @HansHeintz ,

Could you please share a bit more about the "vertrek_datum" column in your '[dbo].[asiel_verblijf]' table? Is it a Date time type column?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Please consider modify your formula as below:

 

ClearCollect(
ZoekDieren;
Filter(
ZoekDieren;
dier_id in Filter('[dbo].[asiel_verblijf]'; IsBlank(vertrek_datum)).dier_id
)
)

 

Or

 

ClearCollect(
ZoekDieren;
Filter(ZoekDieren; IsBlank(LookUp('[dbo].[asiel_verblijf]'; dier_id = ZoekDieren[@dier_id]; vertrek_datum)))
)

 

 

In addition, if the "vertrek_datum" column is a Date time volumn in your '[dbo].[asiel_verblijf]' table, I agree with your thought almost, please consider use Disambiguate operator within your formula. Please modify your formula as below:

ClearCollect(
ZoekDieren;
Filter(
ZoekDieren;
Day(LookUp('[dbo].[asiel_verblijf]'; dier_id = ZoekDieren[@dier_id]; vertrek_datum)) = 0
)
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Re: filtering a collection on an empty date impossible

@HansHeintz 

 

Can you try to modify your expression as:
 
ClearCollect(ZoekDieren;Filter(ZoekDieren;!IsBlank(LookUp('[dbo].[asiel_verblijf]';dier_id=dier_id;vertrek_datum)))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
Community Support
Community Support

Re: filtering a collection on an empty date impossible

Hi @HansHeintz ,

Could you please share a bit more about the "vertrek_datum" column in your '[dbo].[asiel_verblijf]' table? Is it a Date time type column?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Please consider modify your formula as below:

 

ClearCollect(
ZoekDieren;
Filter(
ZoekDieren;
dier_id in Filter('[dbo].[asiel_verblijf]'; IsBlank(vertrek_datum)).dier_id
)
)

 

Or

 

ClearCollect(
ZoekDieren;
Filter(ZoekDieren; IsBlank(LookUp('[dbo].[asiel_verblijf]'; dier_id = ZoekDieren[@dier_id]; vertrek_datum)))
)

 

 

In addition, if the "vertrek_datum" column is a Date time volumn in your '[dbo].[asiel_verblijf]' table, I agree with your thought almost, please consider use Disambiguate operator within your formula. Please modify your formula as below:

ClearCollect(
ZoekDieren;
Filter(
ZoekDieren;
Day(LookUp('[dbo].[asiel_verblijf]'; dier_id = ZoekDieren[@dier_id]; vertrek_datum)) = 0
)
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,755)