Onverting Postal Codes to Array and Comparing for Regional Classification

Hi everyone,

I’m currently working on an automation scenario and need some help with the following:

  1. I have a list of postal codes (e.g., “L6H”, “L6J”, “L6K”, etc.) that I need to convert into an Array. Unfortunately, I’m running into issues with the syntax or formatting while using toArray in Make.com (or other similar tools). Could someone guide me on how to properly structure this list so it becomes a valid Array?
  2. Once I successfully create the Array, I need to compare another postal code (which consists of six characters, e.g., “L6H123”) against this Array. The goal is to check if the first three characters of the six-character postal code match any of the values in the Array. If there’s a match, I want to classify it as belonging to a specific region.

What I need help with:

  • How to properly create the Array from the list of postal codes (what’s the correct syntax?).
  • How to write a condition that checks if the postal code starts with any of the values in the Array and assigns it to a region (without writing lot of conditions like i did

    ).

I’d appreciate any examples, detailed explanations, or best practices. Thank you so much in advance for your help!

GTAZipCodes
{{toArray(“L6H,L6J,L6K,L6L,L6M,L7G,L7J,L7L,L7M,L9T,L1B,L1C,L1E,L1G,L1H,L1J,L1K,L1L,L1M,L1N,L1P,L1R,L1S,L1T,L1V,L1W,L1X,L1Z,L3P,L3R,L3S,L4G,L4H,L4J,L4K,L4L,L6A,L6B,L6C,L6E,L4T,L4V,L4W,L4X,L4Y,L5A,L5B,L5C,L5E,L5G,L5H,L5J,L5K,L5L,L5M,L5N,L5P,L5R,L5S,L5T,L5V,L5W,L6P,L6R,L6S,L6T,L6V,L6W,L6X,L6Y,L6Z,L7A,M1K,M1L,M1M,M1N,M2H,M2J,M2K,M2L,M2M,M2N,M2P,M2R,M3A,M3B,M3C,M3H,M3J,M3K,M3L,M3M,M3N,M4A,M4B,M4C,M4E,M4G,M4H,M4J,M4K,M4L,M4M,M4N,M4P,M4R,M4S,M4T,M4V,M4W,M4X,M4Y,M5A,M5B,M5C,M5E,M5G,M5H,M5J,M5K,M5L,M5M,M5N,M5P,M5R,M5S,M5T,M5V,M5W,M5X,M6A,M6B,M6C,M6E,M6G,M6H,M6J,M6K,M6L,M6M,M6N,M6P,M6R,M6S,M7A,M7Y,M8V,M8W,M8X,M8Y,M8Z,MM9,M9B,M9C,M9L,M9M,M9N,M9P,M9R,M9V,M9W”)}}


1 Like

Hi @Victoria_Grib

Could you please define the source of the zip codes coming from. It will help us to understand and create a solution.

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

Oh thank you - i found the decision


it has to be like this

thank you very much :slightly_smiling_face:

3 Likes