Hello I am new to Corvid. What i would like to do is have a drop down that filters only a desired fields in a column. For example have a drop down that filters size, weight, and height. I also have another column labeled color. I would only like the drop down to filter a certain color in that “Color” column and present it in a text box/field.
The code below filters through the Size, Weight, and Height column. I would only like to filter the red color in the Colors Column. So the results for only red are shown. I do not want to add a Colors drop down, to select red. I want red already to be selected for the drop downs to start filtering.
Hello J.D. thank you for replying so soon. Unfortunately when I preview, and click on the filter button. Nothing filters and no results in my text/field show.
If I take away what you have added and filter, it will work except it will show all the colors…
@bensmitth so be sure to use the correct field key (is it “color”? “colour”? something else?). and make sure you have “red” as value in your collection.
By the way, no need to have “async” in your onClick() function unless you use “await” later in the code you haven’t posted.
The correct field key is “color” and yes “red” is a value in my collection. Deleting the “async” seems to be the problem. Works perfect now. Thank you so much J.D. for your help!
@bensmitth I don’t understand your code. You have 3 different button1. onClick() Why? what are you trying to do?
And why are they async?
And I don’t see where you close the functions.
Hello J.D. sorry for the confusion did not mean to paste it like that. I am new to Corvid so thank you for your patience. All I would like to do is repeat what happened with the color red in a text field but also show the results for green in another text field. So when users select the drop down and click the button the result for red will be text2 and the green result will be in text5. I thought this code would work (see below) but after clicking the button, just shows the green results in text2 and text5.
at the left side of the page there’s a vertical editor bar that contains many buttons (such as “menu”, 'background", “+”, “apps” etc…).
Click the database icon >
Select: “Add Content Element” >
Select: “Dataset”.
Then the dataset will be added to the page, click its settings and connect it to the collection.
Sorry, it’s still not clear.
First of all the code you posted contains some errors and I’m not sure how it could run at all.
Second, I’m not sure where and how you assign the data to the textboxes (and what this data are). Please elaborate.
When you first helped me by adding .eq(“color”,“red”) really did help a lot. I just want to add the color green and for that to appear in the next text field. The results for red will appear in “text2” but i also want to the results for green to appear in “text5”. Sorry for any confusion.