I have items I need to submit to a webhook using the Rules engine. Each item has a few referenced fields. How would I go about resolving multiple referenced fields? This does not work at all.
var jsonObject = {
id:event.id,
tags: [],
categories:[]
};
getReferences(event.data.tags.iv, function(tagNames){
for(var tag of tagNames){
jsonObject.tags.push({
id:tag.id,
tagName: tag.data.tagName.iv
});
}
}
);
getReferences(event.data.categories.iv, function(categories){
for(var cat of categories){
jsonObject.categories.push({
id:cat.id,
tagName: cat.data.displayName.iv
});
}
}
);
JSON.stringify(jsonObject)