> For the complete documentation index, see [llms.txt](https://docs.fieldsraven.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldsraven.app/code-examples/create-a-list.product_reference-metafield.md).

# Create a list.product\_reference metafield

{% hint style="warning" %}
Same rule as the single reference: **plain numeric ids**. FieldsRaven maps the array to `gid://shopify/Product/<id>` for each entry.
{% endhint %}

{% hint style="info" %}
Shopify caps a list metafield at **128 values**.
{% endhint %}

## Before you start

Paste the raven's **Get Code** output into your theme first — that Liquid computes the signature and defines `window.FR_<RESOURCE>_<KEY>`. See [Quick Start](/quick-start.md). The snippets below assume it is present, and use `cfg` for it.

## Sending a value

`value` is a **JSON string** containing an array of numeric product ids — not a JavaScript array.

{% hint style="warning" %}
Pass `JSON.stringify([...])`. The server parses `value` as a string before mapping the ids, so a bare array fails validation with **422**.
{% endhint %}

```javascript
async function submit(value) {
  var cfg = window.FR_CUSTOMER_MY_KEY;              // from the Get Code panel

  var res = await fetch('/apps/raven/create_metafield', {
    method: 'PUT',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      raven: {
        raven_id:   cfg.ravenId,
        resource_id: cfg.resourceId,
        raven_mac:  cfg.ravenMac,
        value:      value
      }
    })
  });

  if (res.status === 429) return console.warn('Busy — retry shortly.');
  var data = await res.json().catch(function () { return {}; });
  if (!res.ok) return console.error(data.message || 'Rejected.');
  console.log(data.message);            // "Sit tight the raven is on it!"
}
```

```javascript
submit(JSON.stringify(['7418351251511', '7418351284279']));
```
