Convert fetch API code to ".then" notation code

How can I covert following code into .then notation. I want to use strictly use “.then” notation. That is what I observed with my system.

var obj = [{"Id":"10101","descr":""},{"Id":"10102","descr":""},{"Id":"10103","descr":""},{"Id":"10104","descr":""},{"Id":"10105","descr":""},{"Id":"10106","descr":""},{"Id":"10107","descr":""}];
var temp = [];
for (var i = 0; i < obj.length; i++){     
var id = obj[i].Id;
    let response = await fetch(''+id+'/value', {method : "GET", headers: {"Authorization": "xyz"}});
    var data = await response.json();
    var stats = data.status; 
        if (stat != "OK")
                    temp.push({Id:obj[i].Id, descr:obj[i].descr, value:"ERROR"})

My expected output is, (values of Id and descr will depends on “if statement” in the code)

[{"Id": "10101","descr": "","status": "ERROR"},
{"Id": "10103","descr": "","status": "ERROR"},
{"Id": "10104","descr": "","status": "ERROR"}]

Can someone please help here.

MDN has an example of how to use fetch with then (it’s the first code example on the page).

MDN: Using the Fetch API

Why not use async/await here? You already have the await part.

@RandellDawson, my system doesn’t allow me to use it. In details, await not actually waiting for output to return hence code is failing.

What system are you using? Also, what is the full code you tried to make it work?

I’m utilizing JavaScript event of Dynatrace APM tool (synthetic module). I divided entire logic into three steps. These three steps will have individual JavaScript events. For 1st and 3rd step, I have code ready which is working smoothly. However, the one I mentioned above is 2nd and for which I’m struggling to get required output.
Adding 1st step code here,

fetch('').then((res) => res.json()).then(function(data) {     var value = data.values;     const formatData = (temp) => {         return{             Id, value: {descr}}) => ({Id, descr})); };     var output = formatData(value);     console.log(output) }).catch(e => {    console.log("fetch fail: " + e);});

This issue is sorted. Thanks for the suggestions and support