Hi All,
i have 2 array
allDates =[ 1 , 2 , 3 ... 30]; - (generate from a dataset)
dates = [ 1, 4, 5] - (this i generated from a query)
$w('#repeater4').forEachItem(($item, itemData, index) => { checkLogHistory(userEmail,4) - generate the "dates" array .then(res => { let date = $item('#text3').text console.log(date + " : " + res) checkDateToHistory(res,date) })
}) async function checkDateToHistory (allDates,date) { const result = allDates.some(item => date.includes(item)) console.log(date + " : " + result) return result
the issue now.. based on the console log... even 10 or 24 will be shown as true...
not sure where did I get it wrong... anyone pls help to show me the direction?
hi J>D....
wow... it works like magic by changing this 2 lines.... thks alot
If you save the dates as a number (or array of numbers. like in your example). You'll need:
//.... let date = Number($item('#text3').text); ///.... const result = allDates.includes(date);