Can a conditional statement be used in an attachment field in Google calendar module?

This is the current state of my scenario, its workflow is setup to read a Notion database and populate a Google calendar event, it is a one-way flow but ideal for me since i use Notion to create a Trip planner and all events are entered there and then passed to a shared Google Calendar:

I start with Notion watch database module which includes attachments but the attachment urls have too many characters. Notion uploads → AWS S3 with pre-signed URLs.

  • Those URLs are very long (hundreds of characters with %2F, %3D, etc.).

  • In the inbound bundle, the link is intact, and opening it in the browser works fine.

  • But when I pass it to the Google Calendar APIattachments.fileUrl field, Google silently truncates the URL past a certain length (somewhere ~2000 chars, depends on encoding).

  • That truncation drops the X-Amz-Signature or other required params → and that’s why you get the XML AuthorizationQueryParametersError.

So it seems that Google Calendar isn’t designed to handle giant, expiring URLs in its attachment slot.

The work around was to add an HTTP get module to grab the attachment and pass the name to Google drive. I use a Google search to see if the file has already been uploaded. If it has it routes to the Google update module which then sets a multiple variable:

If the file doesnt exist it routes to the Google upload module and also sets the same variables. These are set up in the router order as 1 and 2, so the variables get populated before pulling them later.

The 3rd route then connects to the “Get multiple Variables” module where i grab the necessary variable names to create the array needed for Google Calendar module array map.

The attachment field in the Google calendar module expects an array if mapping to that field. The array has to follow the Google calendar API which requires a fileUrl (Google’s attachments object supports 3 main properties):
[
{
“fileUrl”: “{{3.webViewLink}}”, #THIS IS REQUIRED
“title”: “{{3.name}}”,
“iconLink”: “{{3.iconLink}}”
}

This works because:

  • {{3.webViewLink}} maps from the Google Drive module output.

  • Same with {{3.name}} and {{3.iconLink}}.
    ]

The caveat with this workflow occurs when there is no attachment link in the database. Ive set up Resume error handlers to allow the workflow to continue because ultimately I want the calendar event created, updated or deleted but at arrival to the Google calendar create or update branch it will fail if the fileUrl variable is empty. It will also fail if i pass an empty array or add a conditional in the attachment field like this:

if {{length(59.array.fileUrl)}}>0;{{59.array}}:wink: or if {{length(59.array.fileUrl)}}>0;{{59.array}};emptystring;) in an attempt include array if exists and populate or just leave blank. This will throw an error like this:

It seems that field does not like strings or conditionals.

The work around unfortunately seems to be to add another router that filters if array exists and fileUrl length > 0 then connect to a Google create module with the attachment field populated and the other route to connect to a Google create module if fileUrl is emplty but leave the attachment field blank. I was looking for a more elegant or programmatic way to do this?

This is a great question, and you’ve done a fantastic job of diagnosing the problem yourself. You’re right—the issue is that the Google Calendar module’s attachments field expects a very specific data type: an array of objects. It will not accept a null, an empty string, or a conditional if statement.

Your workaround of using a second router to create two separate paths (one with attachments and one without) is the most reliable and direct way to solve this problem. It might seem inelegant, but it’s a common and robust pattern in automation platforms when dealing with strict API requirements.


Why the “Programmatic” Solution Fails

You tried to use a programmatic if statement in the attachments field, and it failed with a Data is not an array error. The reason for this is that Make.com’s formula parser returns a string or null if the condition is false. The Google Calendar API, however, is not a computer program that can interpret your if statement. It simply looks at the input, sees a string instead of an array of objects, and throws an error.


The Correct and Reliable Solution: A Second Router

Your proposed workaround is the correct and most elegant solution within the constraints of the platform. Here’s how you can make it work seamlessly:

  1. First Router (Attachment Check): This router’s job is to check if an attachment exists.

    • Path 1 (Attachment Exists): This path will have a filter with the condition: {{length(59.array.fileUrl)}} > 0. This checks if the array of files is not empty.

    • Path 2 (No Attachment): This path will be set as the fallback route. It will catch all cases where there are no attachments.

  2. Google Calendar Modules:

    • On Path 1: You will add a Google Calendar > Create Event module where the attachments field is populated with the array you’ve already aggregated.

    • On Path 2: You will add a Google Calendar > Create Event module, but you will leave the attachments field completely blank.

This two-path approach ensures that you are always sending the correct data type to the Google Calendar API: either a valid array of objects or nothing at all. While it requires an extra router, it is a very clean and reliable solution that will prevent your scenario from failing.

Thanks for the input. I suspected as much and have implemented the workaround. As for the error handlers is the appropriate handler the Resume or Ignore handler ?