> For the complete documentation index, see [llms.txt](https://help.accentuate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.accentuate.io/liquid-guides/check-for-empty-values.md).

# Check for empty values

As a general rule, if a value of a custom field is empty, its corresponding Metafield either does not exist or is an empty string.\
\
A test for that particular custom field will not return anything ("blank" in Liquid terms), which gives you a nice clean syntax for checking if a given field has a value:

```liquid
{% if product.metafields.accentuate.title %}
   <h1>{{ product.metafields.accentuate.title }}</h1> 
{% endif %}
```

If you need to show a default value in case nothing is assigned to a Metafield, you can use the ['default' Liquid filter:](https://shopify.dev/api/liquid/filters/additional-filters#default)

```liquid
<h1>{{ product.metafields.accentuate.title | default: 'Default title' }}</h1> 
```

#### Multi-language fields

For multi-language fields, where there can be a value for one language and no value for another, you will need to test if the content for a specific language is a blank string or not:

```liquid
{% if product.metafields.accentuate.message['en'] != blank %}
  <p>{{ product.metafields.accentuate.message['en'] }}</p>
{% endif %}
```

#### Repeatable fields

If you are testing to see if an element in a **repeatable** field has a value, you need to test if the element's value is  **either** an empty string **or** null, both of which can be tested via the length of the element's value:

```liquid
{% for ingredient in product.metafields.accentuate.ingredients %}
    {% if ingredient.size > 0 %}
     <p>{{ ingredient }}</p>
   {% endif %}
{% endfor %}
```

And, if you are testing to see if a **repeatable** field has **any elements at all**:

```liquid
{% if product.metafields.accentuate.ingredients.size == 0 %}
   <p>No ingredients have been added</p>
{% endif %} 
```

Please see [this article](https://shopify.dev/api/liquid/filters/array-filters#size) for details on using the size filter.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.accentuate.io/liquid-guides/check-for-empty-values.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
