Harybo 0 Posted October 23 hello, i need some help for my function, i make it returned a value under JSON.stringify but since it's an asynchronous function, it sends it to me with promise {result} so I can not use JSON.parse after. If you have a solution to my problem, I do not mind async getItemForPlayerMenu(id) { const playerItem = []; const data = await misc.query(`SELECT u.*, i.itemName, i.usable, i.itemcount FROM user_items u LEFT JOIN items i ON i.id = u.itemId WHERE u.charId = "${id}"`); for (const item of data) { if (item.charId !== id) continue; const v = { id: item.id, owner: item.charId, itemId: item.itemId, amount: item.amount, title: item.itemName, usable: item.usable, poids: item.itemcount } playerItem.push(v); } return JSON.stringify(playerItem); } Promise { '[{"id":1,"owner":6,"itemId":1,"amount":10,"title":"Eau","usable":"Y","poids":1},{"id":2,"owner":6,"itemId":2,"amount":10,"title":"Sandwich","usable":"Y","poids":1}]' } Share this post Link to post Share on other sites