CASE: limit range below 200 accounts (error "Range 'some range' would have more than 200 items")

In rare cases, you might accidentally bump into an error that mentions the following:

Liquid error: Range ‘140100__140350’ would have more than 200 items, which is not allowed in code: assign some_accounts = period.accounts | range:some_range

What does this error mean?

This error means that the variable that defines the range (so some_range) has more than 200 existing accounts in them.

We don’t allow this, hence the error.

How can this be solved?

In the rare cases you do need to call upon all these accounts, you’ll need to split up the range in several parts, like this:

{% comment %}define several ranges where each part does not have more than 200 accounts{% endcomment %}
{% assign some_range = "14010_14034,140350" %} 

So by splitting the range into several parts, where each part does not have more than 200 items, can you workaround this error.

We hope this happens rarely though, but figured it probably is worth mentioning it.