An array is formed of the form fields that the user has filled. Further, depending on how many elements in the array, the function is called as many times as one of whose arguments should be an array containing an object. The task is that I need to represent the value of the array in each iteration as an object property.

var roles = ['CREATED_BY','RESPONSIBLE_ID','ACCOMPLICE','AUDITOR']; roles.forEach(function(role) { BX24.callMethod('task.item.list', [ {ID : 'desc'}, { REAL_STATUS: [1, 2, 3, 4, 6], /*вот сюда должно подставляться значение элемента массива roles*/: //здесь значение свойства, }, ], function(result) { console.info(result.data()); console.log(result); } ); }); 

    1 answer 1

    Those. and key and value - value from array?

     var roles = ['CREATED_BY','RESPONSIBLE_ID','ACCOMPLICE','AUDITOR']; roles.forEach(function(role) { console.log([ {ID : 'desc'}, { REAL_STATUS: [1, 2, 3, 4, 6], [role]: role, }, ]); }); 

    • Thank you, what you need) - Svyatoslav Gerasimov