I have this code:
// Select all date elements that are not disabled
let availableDates = document.querySelectorAll('.calendar__date-container:not(.is-disabled) .calendar__date');
// Log or process the available dates
availableDates.forEach(date => {
console.log(date.textContent); // Replace with your processing logic
});
Which does work in console on edge, but if I try to put it in Power Automate Desktop, it just returns object object.
I have tried adding a new return line as the following:
return JSON.stringify(date.textContent);
But still the same. I can read that it might be because its an object, but can't get it to return the values..
btw, tried this https://masteringjs.io/tutorials/fundamentals/foreach-object, with some help from chatGPT, but still no luck, again it does seem to work in console.
let availableDates = document.querySelectorAll('.calendar__date-container:not(.is-disabled) .calendar__date');
let datesArray = [];
availableDates.forEach(date => {
datesArray.push(date.textContent);
});
return JSON.stringify(datesArray.join(', ')); // Replace with your processing logic