Hello there,
I am trying to do 2 jobs in this question
1
i Have a DB called Logo (before i use to store logos in it so did not bother to change the name)
this DB has services list [ which i then reference them in other DB ]
first i am looking to make multiple buttons as per Service Type, which was achieved easily
now when i tried to get the label value , i got this !!
the label is “Button” not Promotional Video
which then i am not able to go for the second function to do the filtering
so
2
i want to do a filter of a referenced filed for database 1 “Request Form”
so what it should happen, is that
when “Logo Design” button is pressed
label value is used for referenced filter
i used this code which i cannot check as first object did not work right
export function buttonService_click(event) {
//on of the button is clicked (it is a repeater)
let buttonClicked = $w('#buttonService').label;
console.log(buttonClicked);
//i should get the button value of service type
wixData.queryReferenced('RequestForm', buttonClicked ,"serviceType")
.then( (results) => {
if(results.items.length > 0) {
$w("#dataset1").setFilter( wixData.filter()
.eq("serviceType", buttonClicked)
)
//by referencing DB 'RequestForm' for data set "serviceType" using the ID of button clicked i should get it filtered
} else {
// handle case where no matching items found
}
} )
.catch( (err) => {
let errorMsg = err;
} );
so can i get help please
thank you for all the support in advance