Q:

How to Resolve Promise for Another Promise?

The title is confusing, sorry.
I need to look at the contents of a promise for a subsequent promise. 
See my previous thread for context: How to sequentially handle asynchronous results from API?
I have working code below, and I annotated my problem:
    var promises = [];

    while (count) {
        var promise = rp(options);
        promises.push(promise);
        // BEFORE NEXT PROMISE, I NEED TO GET ID OF AN ELEMENT IN THIS PROMISE'S DATA
        // AND THEN CHANGE 'OPTIONS' 
    }

    Promise.all(promises).then(values => {
        for (var i = 0; i < values; i++) {
            for (var j = 0; j < values[i].length; j++) {
                results.push(values[i][j].text);
            }
        }
        return res.json(results);
    }, function(reason) {
        trace(reason);
        return res.send('Error');
    });

A:

This is a perfect example of how promises can be chained, because the result of then is a new promise.
while (count) {
    var promise = rp(options);
    promises.push(promise.then(function(result) {
        result.options = modify(result.options);  // as needed
        return result.options;
    });
}

In this way, each promise given to Promise.all can be preprocessed.

