Creating a conditional array for Gmail attachments

Hello Makers,

I’m trying to send email with Gmail with a a calendar event and optional PDF attached.

  • The calendar event is constructed.
  • The PDF is optionally downloaded from Airtable.

When the optional PDF does not exist, Gmail’s “send an email”-module fails with error “Missing value of required parameter ‘data’.” - or is there a way to ignore it?

Alternatively, I’m trying to map the attachments by creating an array that conditionally includes the PDF and otherwise only the calendar event, but am struggling to achieve this. Is using the Parse JSON module the right way to do so or am I off track?