This is the code and repeater I’m trying to connect.
I’ve been with WIX for three years and I’ve run through so many tutorials and documentations with Velo and YouTube (sometimes captions isn’t available) and I could never get the coding down. I’m trying to classify the sports schedule per sport. The value doesn’t appear to be correct. Pointers or directions appreciated. Thanks!
First of all the element Id in your code is wrong (it should not contain spaces)
You should use the element ID not the database value.
Second, in order to extract a value from a repeater you have to do it differently.
If you post the code itself and not a screenshot, I may be able to show you how (I don’t want to type it)
import wixData from 'wix-data';
export function boysbball56button_click(event) {
let vis = $w("#boysbball56").collapsed
if (vis){
$w("#boysbball56").expand()
wixData.query("ms_sports_schedule")
.eq("Sports",$w("#Boys Basketball 5-6").value)
} else {
$w("#boysbball56").collapse()
}
}
The element ID can’t have any spaces it doesn’t allow it.
Also you are searching for Sports.
Check if Sports is also with a capital ‘S’ as Value.
when you type Sports as the name it automaticaly changes the Value to sports
@jonatandor35 Yeah, I’m working on it. I changed it to “title” since that’s what the field key says. I’m struggling with the value. (no spaces), renaming them and hopefully an accomplishment coming up soon. Thank you!
@jfriede You cannot change an existing filed key. Even if you changed the label to “Title”, the field key will be “sports”.
If you wish to have a field key “title” - use another column.
I think I have it all wrong. When clicking a sport (button) to pull a specific schedule to display. There are several sports schedules in one dataset. I want to pull one sports’ schedule when clicking on the button.
I’ve tried editing last night and this morning and I’m nowhere closer. I guess I’ll have to create a database per sport. Ugh!
Hi JFriede,
The best way to do what you are doing is to make it dropdowns instead of buttons.
A dataset can be filtered using multiple dropdowns.
This way you can select your sport (Footbal) and the team where you need the schedule of.
yes the shown code above, can be upgraded and compressed by using some loops, but for beginners it is recommended not to do this → (code is better readbale and understandable