I wish to get a specific element (item) from a collection, more precisely a specific number from the latest user input. I have connected the inputs to a database called TestData, see pic
In the above the latest inputted input is line 1. Is the item the entire line and the item id 1? If this is true how come results is not outputted in the console window, using the following code?
@erik Hmm, so my previous answer wasn’t quite right - didn’t notice that you were doing a get().
Your original code is correct, but you need to make sure that you have an item with the _id equal to ‘00001’. Or better, you need to do the get for an id that you know exists in the collection. Look in the _id field of the collection, copy a value from one item, and use that in yoiur query. Your original code shoiuld work:
let id = < use a value from the _id field for an item (row) >
wixData.get("TestData" , id)
.then( (results) => {
console.log(results);
} )
.catch( (err) => {
let errorMsg = err;
} );