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

Re: Filter Gallery Combobox Choice with textinput or other combobox?

Noticed same situation now with the datepicker option.

When it is cleared nothing is shown in the gallery.

I need it to show everything if no date is slected.

same as with the dropdown as i wrote about.

 

Community Support Team
Community Support Team

Re: Filter Gallery Combobox Choice with textinput or other combobox?

Hi @Oskarkuus ,

Based on the issue that you mentioned, I think there is something wrong with your operation.

 

Firstly, do you want to add a blank string value within your Dropdown5 as available options? If yes, please set the Items property of the Dropdown5 to following:

 

["Pending";"Klar"; ""]

Do you want to filter your Gallery items whose Status value is "Pending" or "Klar" when you select the third option within your Dropdown5?

 

Based on the needs that you mentioned, I have made a test on my side, please modify your formula as below:

 

If(
   IsBlank(DatePicker1.SelectedDate);
   SortByColumns(
           Filter(
                  'Underlag Kostnader';
                   If(Dropdown5.Selected.Value=""; true; Status.Value = Dropdown5.Selected.Value);  /* <-- I assume that you add "" as the third option your Dropdown5 */
                   TextInput1.Text in "Beskrivning"; 
                   TextInput1_1.Text  in "Title"
          );
           "Created"; Descending
    )
   ;
   SortByColumns(
           Filter(
                  'Underlag Kostnader';
                   If(Dropdown5.Selected.Value=""; true; Status.Value = Dropdown5.Selected.Value);
                   Text(Skapad; "[$-sv-SE]yyy/mm/dd") = Text(DatePicker1.SelectedDate; "[$-sv-SE]yyyy/mm/dd");
                   TextInput1.Text in "Beskrivning"; 
                   TextInput1_1.Text  in "Title"
          );
          "Created"; Descending
   )
)

Note: I assume that you could edit the DatePicker control (DatePicker1) within your app. Set the Default property of the DatePicker control to blank (not Default value --> Today()).

 

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

Re: Filter Gallery Combobox Choice with textinput or other combobox?

Add in if statement so if date selection is blank filtered and search that includes it and if not filter and search that doesn’t.
Oskarkuus
Level: Powered On

Re: Filter Gallery Combobox Choice with textinput or other combobox?

Still struggling with this one.

 

This code works really well now.

SortByColumns(Filter('Underlag Kostnader';If(Dropdown5.Selected.Value=""; true; Status.Value = Dropdown5.Selected.Value);TextInput1.Text in Beskrivning;TextInput1_1.Text in Rubrik;TextInput1_4.Text in Author.DisplayName;TextInput1_3.Text in Skapad);"Created";Descending)

Only issue is the dropdown5 code that works when loading the app.

But if i select one option and then select the "" empty value. Nothing shows. It only works when reloading the app, then it shows all posts, but i can not select the "" value

 

screenshots:

http://prntscr.com/n38azg

http://prntscr.com/n38bex

 

 

So sorting works

I can search all fields mentioned in the code

I can change dropdown between option 1 and option 2. But i can not change to option 3 (empty), where i want to show option 1 and 2 in the list/gallery.

 

 

Super User
Super User

Re: Filter Gallery Combobox Choice with textinput or other combobox?

You have your If in the wrong place...it needs to be If blank filter one way and if not filter another...try something like this:

 

SortByColumns(
If(Dropdown5.Selected.Value="",
Filter('Underlang Kostnader',
(TextInput1.Text In Beskrivning;
TextInput1_1.Text In Rubrik;
TextInput1_4.Text In Author.DisplayName;
TextInput1_3.Text In Skapad
) )
,
Filter('Underlang Kostnader',
(Status.Value = Dropdown5.Selected.Value;
TextInput1.Text In Beskrivning;
TextInput1_1.Text In Rubrik;
TextInput1_4.Text In Author.DisplayName;
TextInput1_3.Text In Skapad
) )

)
,"Created",Descending)

 

 

 

Highlighted
Oskarkuus
Level: Powered On

Re: Filter Gallery Combobox Choice with textinput or other combobox?

I just get a bunch of errors on that one

 

SortByColumns(
If(Dropdown5.Selected.Value="";
Filter('Underlang Kostnader';
(TextInput1.Text in Beskrivning;
TextInput1_1.Text in Rubrik;
TextInput1_4.Text in Author.DisplayName;
TextInput1_3.Text in Skapad) )
;
Filter('Underlang Kostnader';
(Status.Value = Dropdown5.Selected.Value;
TextInput1.Text In Beskrivning;
TextInput1_1.Text In Rubrik;
TextInput1_4.Text In Author.DisplayName;
TextInput1_3.Text In Skapad
) )

);
"Created";Descending)

 

screenshot:

http://prntscr.com/n38pe8

 

Super User
Super User

Re: Filter Gallery Combobox Choice with textinput or other combobox?

I typically put commas all the places you have semi colons...I didn't change how you had it but you might try that.

 

Also...if you are looking for if your dropdown is blank but is it ever actually going to be blank? Usually only a combo box will allow you to not have something selected but a dropdown always requires a selection...how are you doing that? Do you have a drop down option included in there that is "" ?

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 40 members 4,381 guests
Please welcome our newest community members: