---
title: "get_metafields"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/filter/get-metafields'
  md: 'https://developer.shopline.com/docs/sline/filter/get-metafields.md'
---

# get_metafields


    Gets the metafield objects associated with the given resource object.

    To be used in combination with the following objects:

- [product](https://developer.shopline.com/docs/sline/object/product.md)
- [collection](https://developer.shopline.com/docs/sline/object/collection.md)
- [blog](https://developer.shopline.com/docs/sline/object/blog.md)
- [article](https://developer.shopline.com/docs/sline/object/article.md)
- [page](https://developer.shopline.com/docs/sline/object/page.md)
- [order](https://developer.shopline.com/docs/sline/object/order.md)
- [customer](https://developer.shopline.com/docs/sline/object/customer.md)
- [variant](https://developer.shopline.com/docs/sline/object/variant.md)
- [shop](https://developer.shopline.com/docs/sline/object/shop.md)
- [company](https://developer.shopline.com/docs/sline/object/company.md)

> **CAUTION**
>
> To ensure store performance and responsiveness, the maximum number of times this filter can be called during a single page rendering process is 50. When multiple calls include identical input parameters, these calls will be deduplicated and counted as one call. Once the call limit is reached, subsequent calls will return `nil`.



    
`obj | get_metafields(namespace)` returns a [`metafields`](https://developer.shopline.com/docs/sline/object/metafields.md) object.
    



    
        ## Required params

        
            - `obj` `any`\: The given resource object. Valid values are as listed above.
        
            - `namespace` `string`\: The namespace of the metafields.
        
    





    
## Example

        
            

            

            

            
<SlineExample path={'/products/vip3'} objects={ 
    [""] 
}>
```sline
{{#var mf = product | get_metafields("demo_ns") /}}
{{ mf.demo_key.value }}
```
</SlineExample>
            
        
    
