How do I filter blog posts in a repeater via button click for different Blog categories?

Question:
So, I’ve been told to design a wix blog age that displays posts in a repeater and be able to change the category of those listed posts via buttons. Why a repeater? Because one can’t design the blog post list as freely as a repeater.

I’ve not been able to figure out a code that works to switch the category of the posts… when I try, I get a:

  1. “error: WDE 0080: Validation failed”
  2. Nothing happens
  3. the entire repeater disappears with no error in the console.

Any help?

Product:
WIX editor, in developer mode

I’ve included a snippet of the section in question. There are 5 categories all of which are to show 3 posts per category.I’ve included a snippet of the section in question. There are 5 categories all of which are to show 3 posts per category.


NOTE: I unlinked the image and title for privacy reasons. ALSO you see the “Articles” category written on the 1st post, that’s because it is under both Featured and Articles categories NOTE: I unlinked the image and title for privacy reasons. ALSO you see the “Articles” category written on the 1st post, that’s because it is under both Featured and Articles categories

attempted
I even tried to use ChatGPT as a saw no similar situations when googled.

What is the code you tried?

forms on this worked the best, Basically I used several forms of this

    // Add an event handler for the button click
    $w('#switchDatasetButton').onClick(() => {
        // Get the IDs of both datasets
        const currentDatasetId = $w('#repeater').dataSetId;
        const newDatasetId = 'newDatasetId'; // Replace 'newDatasetId' with the ID of the dataset you want to switch to

        // Switch the dataset connected to the repeater
        $w('#repeater').dataSetId = newDatasetId;

        // Refresh the repeater to update the displayed data
        $w('#repeater').refresh();
    });

I am going re-word your question because I think I know what you are trying to do now.

Your question is: How do I filter blog posts in a repeater via button click for different Blog categories?

This is how you find posts in a category: queryPosts - Velo API Reference - Wix.com

The link above should point you in the right direction.

ohhh, queryPosts, not queryCategories? I’ll look into that!
Muhc apreciated

If you query the category it will only ever give you 1 result because only 1 category will match.