Skip to main content

Is it possible to pass a wildcard value to a Smart Object property to filter a list?

 

I have 3 drop-down boxes on a form which I want the user to use to filter a list view, whereby each drop-down relates to a single smart object property. I want the filtering to be optional, so if there is nothing selected in a drop-down, no filter is applied.

 

I thought perhaps passing in a wild card for each empty-value drop-down might be a way to achieve it, but I can't make it happen. I also don't see how to conditionally pass the values to the smart object without creating a complex if statement that is not easily scalable if I want to add more filtering options.

 

The drop-downs do not cascade, they are completely independant and any single combination of values in the drop-downs may return no records in the list.

Hi,

The drop down list gets populated using a rule. You can configure a rule that checks if there is a value selected in a different control (i.e. drop down list) then use the selected value to filter the data returned, Otherwise populate the dropdown list with no filters as show in the screenshot below.

 

 


Hi Mohamed,

Thanks for your response. I appreciate you taking the time to answer my question.

 

I think perhaps I have not been very clear in what I am asking. Here is my form:

The left hand column contains 3 drop-down lists – the Filters. These are not cascading; their values are completely independent of each other.

 

The right hand column contains a list view (shown with no records) at the top, and an item view at the bottom (which is not relevant to my question).

 

The list view should return all records when there are no selections made in any drop-down. But a selection in the Region Filter should return only the records in the list which match that region. The individual selections in each drop-down are cumulative – one doesn’t cancel the others, they must be applied if they are specified, in conjunction with each other.

 

To describe what I am trying to achieve, if I had only one drop-down, for example, the “Filter By Region” drop-down list, I could easily configure a rule so that when the drop-down changes, if it contains a value, then pass that value to the smart object and refresh the list view to apply a filter, and if the drop-down was empty, refresh the list without passing any values to clear the filter.

 

That rule becomes complicated if I have more than one drop-down, and they have to take each other into account.

 

In words, the rule behind each drop-down would be “when the drop-down list is changed, pass the selected values in all of the drop-downs to the smart object behind the list view, and then refresh the list. For any drop down list where there is no selection, pass a wild card to that property rather than an emtpy value, so that no filtering is done on that field”.

If I can’t pass a wildcard, then I have to have different list-refresh rules for every possible combination of value/no value drop-downs, basically if/then statements with 7 possible “ifs” – a solution that doesn’t scale if I later want to add another drop down filter.

 

The question is, can you pass a wild card to a smart object property, so that the rule behind each drop down can pass an "allow all" into the smart object for any drop down that is empty? If I can’t, then does anyone have any suggestions on how to achieve what I am trying to do?

 

Thanks,
Vaughan

 

Post edited to remove my poor choice of words "one rule".


Hi Vaughan, the only approach I could think of right now, is to create a rule for every possible outcome 

drop down list 1

 

drop down list 2

drop down list 3

drop down list 1-2

drop down list 1-3

drop down list 2-3

drop down list 1-2-3

 

one more idea, if you're using SQL server as a backend I would builld a stored procedure to manage this. and call the stored procedure to populate the listview


Hi Mohamed,

Thanks again for your response. The rule for every possible outcome becomes difficult to manage if the users decide to change one of the filter fields or add a new one. 4 dropdowns becomes 15 possible combinations that include a no-value.

 

I am using SQL and didn't think of approaching it in that way, that will definitely allow me to do what I require.

 

Thanks for the suggestion.

 

Vaughan


Reply