Applying filter criteria on data list based on multiple attributes having custom select list

Sga Sit shared this problem 6 months ago
In Progress

I am trying to achieve filtering data list (shipment data) based on two filters - carrier name and status of shipment.

Both the attributes are custom list type where user can select one or more than one values. Based on selection, user will able to see data from the data list after user clicks on "Find" button. Screen attached as attachment.

Case1: user selects carrier as UPS

Case2: user selects carrier as UPS and FedEx

Case3: user selects carrier as UPS and status as "Intransit" and "Delivered".

How to define my filters to achieve this?

Thanks.

Best Answer
photo

We can add some conditions that will check to see if anything is selected in the checkboxes, which will allow you to filter for one of the checkboxes. We've added 4 conditions, here's what they do:

1. Checks to see if nothing is selected in both checkboxes, and will show a 'nothing selected' text if so.

2. Checks to see if the Status checkbox has something selected and if the Reason checkbox is not. If so, it will filter only according to the Status checkbox.

3. Checks to see if the Status checkbox has nothing selected, and if the Reason checkbox does. If so, it will filter only according to the Reason checkbox.

4. Checks to see if both are selected, and will filter according to both checkboxes.

Hope this helps! Please let me know if you have any questions about it.

Comments (15)

photo
1

Check out the attached prototype, which builds on this example. The first checkbox list is used to filter the Data List using the Data Master's value, and the second checkbox list filters the result of that filter.

photo
1

Hi Danielle,

Thanks.

I am not able to see result if i select filter only on 'status'

For example if I select filters as 'Passed' and 'Failed' together using check box then I should be able to see 10 records out of 11 records (records belonging to 'Rejected' will be excluded).


Similarly, if I select filters only on 'Reason', I am not able to see desired result.

For example, if I select filters as 'original' and 'correction' together using check box I should be able to see 8 records out of 11 records (records belonging to 'cancellation' and 'replacement' will be excluded).


Now, if I select filters on both 'status' and 'reason' then your project gives correct result. But in above two scenario when only one filter is selected, it is not giving desired output.

I need two filters but these two filters should work as individual basis as well as in combination.


Please help.

photo
2

We can add some conditions that will check to see if anything is selected in the checkboxes, which will allow you to filter for one of the checkboxes. We've added 4 conditions, here's what they do:

1. Checks to see if nothing is selected in both checkboxes, and will show a 'nothing selected' text if so.

2. Checks to see if the Status checkbox has something selected and if the Reason checkbox is not. If so, it will filter only according to the Status checkbox.

3. Checks to see if the Status checkbox has nothing selected, and if the Reason checkbox does. If so, it will filter only according to the Reason checkbox.

4. Checks to see if both are selected, and will filter according to both checkboxes.

Hope this helps! Please let me know if you have any questions about it.

photo
1

Thanks Danielle.

Your solution worked like charm!

Thanks for your help.

photo
1

I cannot open the link. Is that because I don't have the correct subscription?

photo
1

Do you mean the attachment? If so, you'll need to decompress it before you can open it with Justinmind.

photo
1

I cannot figure out what I am doing wrong. I tried to use your expressions for conditions and the data list is not changing so obviously I am missing something.

photo
1

You can attach the file you're working with here and we can check it out, if you'd like. You'll need to compress it to .zip/.rar format to attach it here.

photo
1

I realize I need to apply the expressions to all of the checklists, however after doing it several times with no luck I just stuck with the one for the first checklist called "plant size" so you could see what I was doing. As you can see, how I have it the data list does not populate with anything when I tap on search in the simulator. Thank you.

photo
1

Looks like you attached an export of one of the screens (.vpa), which doesn't contain the Data Master. Can you attach the entire .vp file?

photo
1

sorry, here's the whole file

photo
1

Apologies for the delay in getting back to you - we discovered a few bugs that were causing the prototype not to work correctly, and we wanted to make sure we had a workaround for you. First, we needed to change the " in the Data Master to 'in', because there's a bug with multiselection type Data Master field with some characters. This is what was causing the Data List not to populate with any information. We're going to work on fixing that for future updates.

Next, we placed the search and Data List into a scrollable accordion, so it's a bit easier to see what you're searching. We then added the multi-search expressions on the 'Search' button. You actually don't need to include any checkboxes in the Conditions. Instead, you can use a condition that checks to see if anything has been selected in each multi-select list, and if so, it will filter according to what's selected. We also added a 'Clear' button, which resets the Data List filter and deselects all of the options in each multi-select list.

Hope this helps, and please let me know if you have any questions.

photo
1

Thank you very much!!! Perfect.

photo
1

I'm sorry, I have another question. I am trying to export that screen and import it into my prototype but the data list does not carry over. How can i get the data list and events to carry over? It's like it is not linking to my data master maybe?

photo
1

You'll need to import the entire prototype for everything to transfer over. You can try deleting all the screens/templates/masters except for the one you'd like to import, and then go to File > Import > Prototype and select that prototype. Before you do so, change the name of the Data Master in either prototype, so that they won't override each other when you import the other prototype.

photo