---
title: "metafield"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/object/metafield'
  md: 'https://developer.shopline.com/docs/sline/object/metafield.md'
---

# metafield


    A metafield attached to a specific resource (such as a product or order).

    For more information on how to access a metafield on a resource, refer to [get_metafield](https://developer.shopline.com/docs/sline/filter/get-metafield.md) and [get_metafields](https://developer.shopline.com/docs/sline/filter/get-metafields.md).

Metafields support various data types. To format or render a metafield, use the [metafield_text](https://developer.shopline.com/docs/sline/filter/metafield-text.md) filter and the [metafield_tag](https://developer.shopline.com/docs/sline/tag/metafield-tag.md) tag.




## Properties

    <div>
    

        
<ObjectProperty 
    name="list"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the value of the metafield is a list.
- `true`: The value of the metafield is a list.
- `false`: The value of the metafield is not a list.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="type"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The type of the metafield.

<table>
  <thead>
    <tr>
      <th>Valid values</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>single_line_text_field</td>
      <td>Single-line text</td>
    </tr>
    <tr>
      <td>multi_line_text_field</td>
      <td>Multi-line text</td>
    </tr>
    <tr>
      <td>rich_text_field</td>
      <td>Rich text</td>
    </tr>
    <tr>
      <td>product_reference</td>
      <td>Product</td>
    </tr>
    <tr>
      <td>collection_reference</td>
      <td>Product collection</td>
    </tr>
    <tr>
      <td>variant_reference</td>
      <td>Product variant</td>
    </tr>
    <tr>
      <td>page_reference</td>
      <td>Page</td>
    </tr>
    <tr>
      <td>article_reference</td>
      <td>Blog article</td>
    </tr>
    <tr>
      <td>file_reference</td>
      <td>File</td>
    </tr>
    <tr>
      <td>number_integer</td>
      <td>Integer</td>
    </tr>
    <tr>
      <td>number_decimal</td>
      <td>Decimal</td>
    </tr>
    <tr>
      <td>date</td>
      <td>Date</td>
    </tr>
    <tr>
      <td>date_time</td>
      <td>Date and time</td>
    </tr>
    <tr>
      <td>url</td>
      <td>URL</td>
    </tr>
    <tr>
      <td>link</td>
      <td>Link</td>
    </tr>
    <tr>
      <td>json</td>
      <td>JSON</td>
    </tr>
    <tr>
      <td>boolean</td>
      <td>Boolean</td>
    </tr>
    <tr>
      <td>color</td>
      <td>Color</td>
    </tr>
    <tr>
      <td>weight</td>
      <td>Weight</td>
    </tr>
    <tr>
      <td>volume</td>
      <td>Volume</td>
    </tr>
    <tr>
      <td>dimension</td>
      <td>Dimension</td>
    </tr>
    <tr>
      <td>rating</td>
      <td>Rating</td>
    </tr>
    <tr>
      <td>money</td>
      <td>Money</td>
    </tr>
    <tr>
      <td>metaobject</td>
      <td>Metaobject</td>
    </tr>
  </tbody>
</table>


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="value"
    types={[<Mdx>any</Mdx>]}
>
<ObjectSummary>
The value of the metafield.

The following table lists the supported value format for each metafield type:

<table>
        <thead>
            <tr>
                <th>Type</th>
                <th>Return value format</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    `single_line_text_field`
                   
                    `multi_line_text_field`
                </td>
                <td>A [string](https://developer.shopline.com/docs/sline/basics.md#RBRfx)</td>
            </tr> 
            <tr>
              <td>
                `rich_text_field`
              </td>
              <td>Rich text (supports headings, lists, bold, italics, and links)</td>
            </tr>
            <tr>
                <td>
                    `product_reference`
                </td>
                <td>A [product](https://developer.shopline.com/docs/sline/object/product.md) object</td>
            </tr>
            <tr>
                <td>
                    `collection_reference`
                </td>
                <td>A [collection](https://developer.shopline.com/docs/sline/object/collection.md) object</td>
            </tr>
            <tr>
                <td>
                    `variant_reference`
                </td>
                <td>A [variant](https://developer.shopline.com/docs/sline/object/variant.md) object</td>
            </tr>
            <tr>
                <td>
                    `page_reference`
                </td>
                <td>A [page](https://developer.shopline.com/docs/sline/object/page.md) object</td>
            </tr>
            <tr>
                <td>
                    `article_reference`
                </td>
                <td>An [article](https://developer.shopline.com/docs/sline/object/article.md) object</td>
            </tr>
            <tr>
                <td>
                    `file_reference`
                </td>
                <td>
                    One of the following:
                    <ul>
    <li>A `generic_file` object</li>
    <li>An [image](https://developer.shopline.com/docs/sline/object/image.md) or [video](https://developer.shopline.com/docs/sline/object/video.md) object</li>
</ul>
                </td>
            </tr>
            <tr>
                <td>
                    `number_integer`
                    
                    `number_decimal`
                </td>
                <td>A [number](https://developer.shopline.com/docs/sline/basics.md#SVxZp)</td>
            </tr>
            <tr>
                <td>
                    `date`
                    
                    `date_time`
                </td>
                <td>A date string (can be formatted using the [date](https://developer.shopline.com/docs/sline/filter/date.md) filter)</td>
            </tr>
            <tr>
                <td>
                    `url`
                </td>
                <td>A URL [string](https://developer.shopline.com/docs/sline/basics.md#RBRfx)</td>
            </tr>
            <tr>
                <td>
                    `link`
                </td>
                <td>A link object</td>
            </tr>
            <tr>
                <td>
                    `json`
                </td>
                <td>A [JSON](https://developer.mozilla.org/docs/Learn/JavaScript/Objects/JSON) object</td>
            </tr>
            <tr>
                <td>
                    `boolean`
                </td>
                <td>A [boolean](https://developer.shopline.com/docs/sline/basics.md#ocahs) value</td>
            </tr>
            <tr>
                <td>
                    `color`
                </td>
                <td>A [color](https://developer.shopline.com/docs/sline/object/color.md) object</td>
            </tr>
            <tr>
                <td>
                    `weight`

                    `volume`

                    `dimension`
                </td>
                <td>A measurement object</td>
            </tr>
            <tr>
                <td>
                    `rating`
                </td>
                <td>A rating object</td>
            </tr>
            <tr>
                <td>
                    `money`
                </td>
                <td>A money object</td>
            </tr>
            <tr>
                <td>
                    `metaobject`
                </td>
                <td>A [metaobject](https://developer.shopline.com/docs/sline/object/metaobject.md) object</td>
            </tr>
        </tbody>
    </table>
</ObjectSummary>
</ObjectProperty>
        
    
    </div>


