Matrix Version: 5.5.4.2
I am using server side javascript to generate our recipient emails. I would like to be able to output different code if the asset_type_code is form_question_type_file_upload. I have a conditional if/else but it does not work. Is there any obvious reasons why this will not work? Thanks
var assetIDs = %globals_asset_children_link_type_2:221324^as_asset:asset_children_link_type_2,asset_type_code^empty:[]%;
if (assetIDs.length > 0) {
assetIDs.forEach(function(assetID) {
if (assetID.asset_type_code === "form_section") {
assetID.asset_children_link_type_2.forEach(function(asset) {
let typecode = `%globals_asset_type_code:${asset}%`;
var asset = asset.replace(':','_');
if (typecode === "form_question_type_file_upload") {
print(`<p style="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:14px;line-height:25px;font-weight:400;mso-hide:% response_${asset}_file_size^empty:all%;display:% response_${asset}_file_size^empty:none%;">% question_name_${asset}%: % response_${asset}%</p>`);
} else {
print(`<p style="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:14px;line-height:25px;font-weight:400;mso-hide:% response_${asset}^empty:all%;display:% response_${asset}^empty:none%;">% question_name_${asset}%: % response_${asset}%</p>`);
}
});
}
});
}