business lines, owner and services sync with CMDB

business lines, owner and services sync with CMDB
there is no simple create var updated_service_ids = [] and in for loop just updated_service_ids.append(x) and the end of everything create one query where each service ouside list got flat=false?