cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HansHeintz
Level 8

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
Community Support Team
Community Support Team

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

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!
Community Support Team
Community Support Team

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,390)