Condition Email with or without attachment

Mohamed:

Just to repeat Ohad’s question.

What are you actually trying to do?

So for example what is the expected outcome of this code:

if ($w("#Attachment").value.length > 0) {
  const matches = item.fileAttachment.match(convertRegex);
  documentUrl = `docs.wixstatic.com/ugd/${matches[1]}?dn=${matches[2]}`; }

There doesn’t appear to be any relationship between $w(‘#Attachment’) and documentURL. An explanation along with the page link might be helpful :-).

Thanks