Hi there,
i can’t find a solution how to list values of an array of linked table and summ values for same categories.
var ContractID ="2022001";
const result_items = await doo.table.getData('documentsItems', {filter: [
{field: "DI_contractID.CON_contractNo", operator: "in", value: ContractID}
], filterOperator: "and"});
var itemCategory = result_items.data[0].fields.DI_itemCategory;
var itemArray = result_items.data;
const arrayLength = result_items.data.length;
var Total = 0;
for (var i=0; i<result_items.data.length; i++){
// THERE I NEED TO DO IF ARRAY VALUE IS EQUAL TO CATEGORY 1, 2, ..., x - SUMM ALL VALUES FROM FIELD "TOTAL" AND MULTIPLE WITH SOME COEFFICIENT
}
In table Documents items I have dropdown with some categories and for each category I need values from each record of same category and save it as summ to table Documents
Problem is that I need to split these categories because each one I need to multiple with different coefficient.
I could create an extra field for each category - but it’s not good solution because categories can be add by time and I really do not want to have need to edit code again…
Thanks.