I design .

I'm Ketan ‐ A Melbourne web designer, developer and illustrator with 20+ years industry experience.

Head icon.

Shopify Tips

Liquid tip: Removing null values from an array

Here’s a little trick I learned for removing null or empty values from an array in Shopify’s liquid.

By using the compact option like below, we’ll get a nice filtered array back.

{% assign myarray = some_string | split: ',' | compact %}