Hello
I'm building a very small app based on data from a Sharepoint list. I generated the app from the "Integrate" option directly from the Sharepoint list. However I'm still struggling with the syntax, despite finding some examples on what I want to achieve.
I have a SearchTextBox and then a Dropdown. The Dropdown is acting as a filter.
I want to ignore the filter if the selected value is blank. I entered a record in the Sharepoint list with a blank value so that it would populate my dropdown menu.
So my Dropdown1 has this:
Items = Sort(Distinct('Kontaktlista DP';DeviceProviderType);Result; Ascending)
Then in the BrowseGallery1 I have this:
Search(Filter('Kontaktlista DP';DeviceProviderType = Dropdown1.Selected.Result);
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
And naturally I then have a SearchTextBox1 with no applied code or formulas.
Everything here works, but I cant figure out how to put an IF-statement to ignore the Filter is the selected value is blank/null/nothing...
Any friendly soul out there who can point me in the right direction?
Solved! Go to Solution.
@Ricky76 Try this,
Search(Filter('Kontaktlista DP';
If((IsBlank(Dropdown1.Selected) Or IsBlank(Dropdown1.Selected.Value)); true; DeviceProviderType = Dropdown1.Selected.Result));
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
@Ricky76 Try this,
Search(Filter('Kontaktlista DP';
If(IsBlank(Dropdown1.Selected), true, DeviceProviderType = Dropdown1.Selected.Result));
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
@CNT Many thanks for the help, appreciated.
I had to do some modifications to the syntax (mainly replacing "," with ";"), but it's still not ignoring the filter when a blank value is selected from Dropdown1.
This is the slightly modified code I used:
Search(Filter('Kontaktlista DP';
If(IsBlank(Dropdown1.Selected); true; DeviceProviderType = Dropdown1.Selected.Result));
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
I'm stating to think that a blank/empty cell in Sharepoint really isnt blank/empty at all. Could that be the case? The Dropdown1 Filter is working as it should, but when I select a record where coloumn "DeviceProviderType" is blank/empty, the BrowseGallery1 will still use the filter and only show records where "DeviceProviderType" has blank/empty value.
@Ricky76 Try this,
Search(Filter('Kontaktlista DP';
If((IsBlank(Dropdown1.Selected) Or IsBlank(Dropdown1.Selected.Value)); true; DeviceProviderType = Dropdown1.Selected.Result));
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
I understand now 🙂 Just had to do some slight modification to get it to work for me. I had to set it do "Dropdown1.Selected.Result" and then it works! Many, many thanks.
Should I mark your latest post as "Accept as Solution"?
This is what works for me:
Search(
Filter(
'Kontaktlista DP';
If(
(IsBlank(Dropdown1.Selected.Result));
true;
DeviceProviderType = Dropdown1.Selected.Result
)
);
TextSearchBox1.Text;
"Title";
"field_Namespace";
"field_PODName"
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
180 | |
52 | |
41 | |
38 | |
28 |
User | Count |
---|---|
255 | |
81 | |
71 | |
68 | |
66 |