How to use the loop function to solve my data issue

Thanks for the reply, to be honest your option is out of my coding league, I have some basic knowledge and chatgpt is helping me :slight_smile:

Maybe to make it simpler I created this, still works and I could just create a workflow that would go from 1 to 200, update db, go from 201-400, update db etc etc but their must be a smarter simple way that I can understand

const arr = getean.data;

const startIndex = 801; // Set the start index here (0-based)
const endIndex = 1000; // Set the end index here (exclusive)

const eanValues = arr.map(item => item.ean).slice(startIndex, endIndex);

const promises = eanValues.map((ean) => {
    return new Promise(resolve => {
        resolve(eanloop.trigger({
            additionalScope: {
                ean: ean 
            }
        }));
    });
});

return Promise.all(promises);