Hi, i have a probl. small problem.
I’m currently matching user-inputs with a database, which works. But how can i output a specific part of my query?
my table is like this
10 || 20 || S || 15
12 || 14 || M || 16
and i match the first 2 rows with eq() and i get a match, how can i now output the “M” as example and not the whole array? Do i approach (MY) problem from the wrong angle?
my probl. bs code
export function button1_click(event) {
if (warningstate === true ){
$w( “#warning1” ).hide();
$w( “#warning2” ).hide();
warningstate = false ; // resets warningsstates
}
let handlength = parseFloat($w( “#input1” ).value);
let handdiasize = parseFloat($w( “#input2” ).value);
if (handlength >= 16 && handlength <= 99 || handdiasize >= 31 && handdiasize <= 99 ){
$w( “#warning1” ).show();
console.log( “Nicht verfügbare Handschuhgröße” ); // We do not have such sizes
warningstate = true ;
}
else if (handdiasize >= 100 || handlength >= 100 || handdiasize >= 100 && handlength >= 100 ){
$w( “#warning2” ).show();
console.log( “Viel zu große Zahl” ); // thats not a possible handsize
warningstate = true ;
}
async function getData () {
wixData.query( “Handschuh_size” )
.eq( “handdiasize” , handdiasize)
.eq( “handlength” , handlength)
.find()
.then( (results) => {
if (results.items.length > 0 ) {
console.log( “Gab ein Match” ); // I got a Match
console.log(results.items);
// How to continue from there
// Output should be handsizevalueA
}
else {
console.log( “Hier ist etwas schief gelaufen” ); // This did not work
console.log(handlength + " " + handdiasize)
}
})
}
console.log(handdiasize + " Handdurchmesser" + handlength + " Handlänge" );
$w( '#text22' ).text = handsizevalueA;
