I'm trying to create a chat bot that gets the user input from a text box, assigns it to a variable, and then if that variable matches the name of one of the listings in the database, return the response associated with that listing. However I can't for the life of me work out how to return ONLY the second column for a result in a database query. It returns the entire line.
I'm really lost because the Wix API still doesn't make it very clear as to how I'm meant to refine searches using the query function. Can anyone give me some pointers please? import wixData from 'wix-data'; $w.onReady(function () { }); export function sendButton_click(event) { var userInput = $w("#userInput").value wixData.query("responses") .contains(userInput) .find() .then( (results) => { if(results.items.length > 0) { let items = results.items; let firstItem = items[0]; $w("#responseText").text = items[0]; } else { $w("#responseText").text = "I'm sorry, I don't understand."; // handle case where no matching items found } } ) .catch( (error) => { let errorMsg = error.message; let code = error.code; } ); }