Сохраните дополнительную переменную счетчика, которая увеличивается, когда происходит пустое поле.
// variable for keeping track of empty field
let c = 0;
for (let i = 0; i < result.length; i++) {
// chek value or couter in addition to your condition
if (c === 0 && result[i].mkp == ' ') {
//the first time that a empty field happen
//the array position is filled with "FRANQUIAS"
result[i].mkp = "FRANQUIAS";
// increment counter value whenever empty field occurs
c++;
}
else if (c === 1 && result[i].mkp == ' ') {
//the second time that a empty field happen
//the array position is filled with "TELEVENDAS"
result[i].mkp = "TELEVENDAS";
c++;
}
else if (c === 2 && result[i].mkp == ' ') {
//the third time that a empty field happen
//the array position is filled with "OCC"
result[i].mkp = "OCC";
c++;
}
}
Вы даже можете упростить код, используя массив, содержащий эти значения.
// variable for keeping track of empty field
let c = 0;
// array which contains the value
const val = [ 'FRANQUIAS', 'TELEVENDAS', 'OCC'];
for (let i = 0; i < result.length; i++) {
// check counter is less than 3(update if there is more possibility or use c < val.length)
// and check value is empty
if (c < 3 && result[i].mkp == ' ') {
// update value with corresponding value in array
// and increment, where `c++` returns current value and increments
result[i].mkp = val[c++];
}
}