Creating selection tags based on boolean values

I was able to create a simple code to filter based on a selection tag connected to one value field but instead I want to be able to connect each value in the selection tag to a boolean value. Currently the “meal” value is comprised of Organic, Vegan, and Low-Fat but I want each of the selection tag option to be connected to three boolean values of organic, vegan, and lowFat.

I’ve tried many different ways to no avail so was hoping someone could help me solve this. I’ve posted the current working code below based on a single value.

import wixData from 'wix-data';
$w.onReady(function () {

filterView();

    $w("#selectionTags1").onChange( (event, $w) => {
      filterView();
    });

    $w("#dropdown1").onChange( (event, $w) => {
      filterView();
    });
});

function filterView(){
   var mealFilter = $w("#selectionTags1").value
   var deliveryFilter = $w("#dropdown1").value
   
   $w("#dataset1").setFilter( wixData.filter()
   .hasSome("meal", mealFilter)
   .hasSome("mealsPerWeek", deliveryFilter)
   )
}

Hello.

You can refer to this Forum post to return the value of the last clicked selection tag: https://www.wix.com/corvid/forum/community-discussion/trigger-event-when-a-tag-of-selectiontags-is-selected/p-1/dl-5ebd70793ca3f5002d564aa1-5ebd6e1f84789e002d96ac18-1?commentId=5ebd6e1f84789e002d96ac18&origin=notification&postId=5ebd3b1c32cadc0017629cac&replyId=5ebd70793ca3f5002d564aa1

Good luck!

Thanks Sam. The selection tags are currently working as is, I just want them to be connected to boolean values as opposed to one value field. Is there a way to update my current code to reflect that?