cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Oskarkuus
Level: Powered On

Filter not working, gallery excludes rows with empty values

I need help to fix my filter.

I have this filter:

SortByColumns(Filter(Lovskola_Elever;If(Dropdown5.SelectedText.Value=""; true; Årskurs.Value = Dropdown5.SelectedText.Value);TextInput1.Text in Skola.Value;TextInput1_6.Text in Amne;TextInput1_1.Text in Rubrik);"Title";Ascending)

If my datasource column = "Amne" is empty for some reason, then they are not shown in my gallery.

 

Why?

 

I need all records to always show in my gallery, not be excluded for some strange reason.

 

 

3 REPLIES 3
Super User
Super User

Re: Filter not working, gallery excludes rows with empty values

Hi @Oskarkuus 

 

Can you give it a try using the below expression:
SortByColumns(
    Filter(
        Lovskola_Elever;
        If(
            Dropdown5.SelectedText.Value="";
            true;
            Årskurs.Value = Dropdown5.SelectedText.Value);
        TextInput1.Text in Skola.Value;
        If(IsBlank(Amne);true;TextInput1_6.Text in Amne);
        TextInput1_1.Text in Rubrik);
    "Title";Ascending
)
 
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!
 
KroonOfficeSol
Level 10

Re: Filter not working, gallery excludes rows with empty values

@Oskarkuus 

 

Try this first

SortByColumns(
	Filter(Lovskola_Elever	
		;1=1
		;OR(Dropdown5.Selected.Value=""; Årskurs.Value = Dropdown5.Selected.Value)
		//;TextInput1.Text in Skola.Value // This could also resolve to the problem based on Delegation Issues
		;TextInput1_6.Text in Amne
		;TextInput1_1.Text in Rubrik
	)
	;"Title"
	;Ascending
)

If works then take away the // on the third filter and see if still works. If not then you have delegation issue at hand.

If it does not work then // 'comment out' the other three filters to see what happens. Still no data, your datasource is empty or should be refreshed/re-connected. Is there data then de-comment the filters one by one.

 

Btw, the ; 1 = 1 result always to true, which enables you to add the filter() formula without a real filter. So this behaves the same as only entering your datasource alone. 

 

Hope this helps,

 

Paul

Community Support Team
Community Support Team

Re: Filter not working, gallery excludes rows with empty values

Hi @Oskarkuus ,

Could you please share a bit more about your scenario?

 

I have made a test on my side, please consider modify your formula as below:

SortByColumns(
Filter(
Lovskola_Elever;
If(Dropdown5.SelectedText.Value = ""; true; Årskurs.Value = Dropdown5.SelectedText.Value);
TextInput1.Text in Skola.Value;
If(IsBlank(Amne), true, TextInput1_6.Text in Amne); /* <-- Modify formula here */
TextInput1_1.Text in Rubrik
);
"Title";
Ascending
)

 

If the issue still exists, please consider save your data source into a Collection, then use the Collection as data source within your app. Please take a try with the following workaround:

Set the OnStart property of the App control to following:

ClearCollect(RecordsCollection; Lovskola_Elever)

Then modify your formula as below:

SortByColumns(
Filter(
RecordsCollection;
If(Dropdown5.SelectedText.Value = ""; true; Årskurs.Value = Dropdown5.SelectedText.Value);
TextInput1.Text in Skola.Value;
If(IsBlank(Amne), true, TextInput1_6.Text in Amne); /* <-- Modify formula here */
TextInput1_1.Text in Rubrik
);
"Title";
Ascending
)

then re-load your app, then take a try with above formula, check if the issue is solved.

 

Please consider take a try with above formula, 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.