# Image URL settings

### XML

You may encounter an XML structure where links to images are stored in separate **Image** nodes.

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/Qcx4hJvQF7hKTg3ky4Bi" alt="Images stored in separate Image nodes annotated"><figcaption><p>Images stored in separate Image nodes</p></figcaption></figure>
{% endtab %}

{% tab title="XML snippet" %}

```xml
<Product>
  <Items>
    <ProductItem>
      <ItemCode>A012345</ItemCode>
      <ItemImage1>http://warehouse.com/images/A012345.jpg</ItemImage1>
      <ItemImage2>http://warehouse.com/images/A012345_1.jpg</ItemImage2>
    </ProductItem>
  </Items>
</Product>
```

{% endtab %}
{% endtabs %}

For the notation above, use the following settings in the Image URL fields:

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/5DELI6mR6zCbYx5sKY1W" alt="Stockeo settings for Image URL fields when images are stored in separate ItemImage nodes annotated"><figcaption><p>Stockeo settings for Image URL fields when images are stored in separate ItemImage nodes</p></figcaption></figure>
{% endtab %}

{% tab title="Copy from here" %}
**Image URL:** Items/ProductItem/ItemImage1

**Image URL:** Items/ProductItem/ItemImage2
{% endtab %}
{% endtabs %}

Another case is when the URLs are nested as the same named children of the Image node.

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/g7tCKd3i3euwBg9WDAru" alt="URLs are nested as the same named children of the Image node annotated"><figcaption><p>URLs nested as the same named children of the Image node</p></figcaption></figure>
{% endtab %}

{% tab title="XML snippet" %}

```xml
<Product>
  <Items>
    <ProductItem>
      <ItemCode>A012345</ItemCode>
      <ItemImages>
        <ItemImage>http://warehouse.com/images/A012345.jpg</ItemImage>
        <ItemImage>http://warehouse.com/images/A012345_1.jpg</ItemImage>
      </ItemImages>
    </ProductItem>
  </Items>
</Product>
```

{% endtab %}
{% endtabs %}

You can extract them with the following settings:

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/j02RImrgH94qcWuAZ8Pq" alt="Stockeo settings when URLs are nested as the same named children of the Image node annotated"><figcaption><p>Stockeo settings when URLs are nested as the same named children of the Image node</p></figcaption></figure>
{% endtab %}

{% tab title="Copy from here" %}
**Image URL:** Items/ProductItem/ItemImages/ItemImage\[1]

**Image URL:** Items/ProductItem/ItemImages/ItemImage\[2]
{% endtab %}
{% endtabs %}

Please note that the indexing of XML lists starts with 1.

### JSON

In the JSON file images may be stored as an array of objects that consist of e.g. image id and image URL.

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/0Va9VslOYdG2JoKZ1Ntg" alt="Image URLs are stored as a property of the object in the product_images array annotated"><figcaption><p>Image URLs are stored as a property of the object in the product_images array</p></figcaption></figure>
{% endtab %}

{% tab title="JSON snippet" %}

```json
{
  "data": [
    {
      "product_code": "A012345",
      "product_name": "Sitting Jazz Band Strings",
      "product_images": [
        {
          "id": 5856,
          "image": "https://warehouse.com/images/A012345.jpeg"
        },
        {
          "id": 5857,
          "image": "https://warehouse.com/images/A012345_1.jpeg"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

In this case use the following settings:

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/09Fom5ealMYKquJUFtRc" alt="Stockeo settings when Image URLs are stored as a property of the object in the product_images array annotated"><figcaption><p>Stockeo settings when Image URLs are stored as a property of the object in the product_images array</p></figcaption></figure>
{% endtab %}

{% tab title="Copy from here" %}
**Image URL:** product\_images\[0].image

**Image URL:** product\_images\[1].image

**Image URL:** product\_images\[2].image
{% endtab %}
{% endtabs %}

Please note that the indexing of array elements in JSON starts at 0.

You can add fields up to the highest expected number of images. This will not cause an error, even if there is no link to the image on the given index.

### Multiple image URLs in a single field/node/column

In some feeds, multiple image URLs may be stored in a single field, node, or column.

<figure><img src="/files/hCwR6lKnUZM1ytHxiZeI" alt="Example CSV feed showing multiple image URLs combined in one column separated by delimiters"><figcaption><p>Sample feed with multiple image URLs stored in a single column</p></figcaption></figure>

In such cases, use a Liquid formula together with multiple Image URL fields.

1. Use a Liquid formula to split the value into an array of URLs. Apply the `split` filter and specify a separator (in this case, a semicolon). Repeat this formula in each Image URL field in the Data Mapping section.
2. In each subsequent Image URL field, reference the next element from the array. Note that indexing starts from 0, regardless of the feed format.

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[0] }}
```

{% tabs %}
{% tab title="Screenshot" %}

<figure><img src="/files/9Lg3Sii8ciQY0HDsUl3o" alt="Configuration screen showing Image URL fields using a split formula to handle multiple URLs from one node"><figcaption><p>Image URL settings for extracting multiple URLs from a single node</p></figcaption></figure>
{% endtab %}

{% tab title="Copy from here" %}
**Image URL:**

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[0] }}
```

**Image URL:**

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[1] }}
```

**Image URL:**

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[2] }}
```

**Image URL:**

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[3] }}
```

**Image URL:**

```liquid
{%- assign image_urls = Images | split: ";" %}{{ image_urls[4] }}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://help.stockeo.solvenium.com/data-mapping/image-url-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
