Query parameter use

Hello Thanks for putting together a great UI service! I am having fun with AppGyver!

I am new and am trying to filter list items based on query parameters.

I have a page where I (repeated) list named items with the properties color and shape.
I would like to filter and display my list items based on item name, color, and/or shape values.
My current list has 14 total entries; my display list page lists only the 1st 10 in order to limit the amount of data uploaded (downloaded?).

I cannot seem to get the filter button to filter as I wish.

Rather than explaining in words, I have made some (unnecessarily large) screenshots and videos of:

  1. my previewed app not working:

  2. my (redacted) data configurator




I think my first (of many) problems (challenges?) is not knowing how the query parameter works- I can’t seem to get the GET COLLECTION to work properly in the data configurator using the query parameter.

Any help would be appreciated, thanks!

Hi, if you want to send a request with “shape=0”, your query parameter should be called shape instead of filter, and on the test tab you will give it a value of 0. Opening the network tab of Chrome’s developer tools will help you to see what kind of requests you’re sending :slight_smile:

Thanks for the quick reply and your advice Mari. I’ll get to work on it and let you know how it all turns out.
Rick

Hi Mari.

I wanted to update you on my progress.

To summarize, I have an app where users enter the following data: item name, color of item, and number of sides of item (for example, “sun”, “orange”, “0”).
I display the list of data to the user via data item in repeat.

I wanted the user to be able to sort the repeated list items by entering one, two, or three search items (item name, color, sides) and display the sorted list.
I was deciding between using a “url placeholder” or “query parameter” with the data configurator to do this.
I use Backendless as my backend.

What I ended up doing was:
I created 6 separate data sets on the data configurator: one for item search alone, one for color alone, one for number of sides alone, one for item + color, etc. (3! = 6)
I used “url placeholder(s)” and linked page variable(s) (search values) to each url placeholder.

I then made one of the 6 data sets “visible” by using formulas to show the appropriate data set in the data item in repeat.

Although this works, it seems very inelegant. If I had a list with 4 elements, for example, and wanted the user to sort based on combinations of all 4 elements, then my solution would require 4! = 24 data sets, and so on.

If you understand what I did, is there an easier way to do this?

Thanks again for your advice.

Rick

Hi, if I understand the case correctly, you could have a single list of all items and then use the SELECT formula to display the items that match your query using page variables that the user can modify.

So you’d have pageVars.color, pageVars.sides, etc. that are then bound to the value of e.g. a dropdown.

A basic query where the user can choose one value for each search criteria:

SELECT(data.Items, item.color === pageVars.color && item.sides === pageVars.sides)

To handle the filter being initially empty, you can use IF(IS_EMPTY(pageVars.color), item.color, pageVars.color) so the filter defaults to item.color === item.colortrue for each item if no filter value is chosen.

If you want to implement multiple-choice filtering, you could have a list pageVars.chosenColors and have tickboxes for each color, which trigger the adding and removal of a color to the list. Then the formula would change to:

SELECT(data.Items, IS_IN_ARRAY(pageVars.chosenColors, item.color) && item.sides === pageVars.sides)

Hope this gave you some idea on how you can move forward!

Thanks so much Mari! I will look your email over and work on things next week. Also thanks for your quick response- I still am amazed that you and AppGyver can provide a free service while also taking the time to understand my question and help people like myself.
Have a great weekend.
Rick