Fluent Commerce Logo
Docs

Working with an Array Item

Essential knowledge

Changed on:

23 Sept 2024

Overview

There are also some useful features for working with arrays. Typically you can access an array item by its index as follows:     `node.attributes.0.value`This works on edges too:    `node.aticles.edges.0.node.ref`Now, you can retrieve Attributes by Name:    `node.attributes.byName.Size`In our example, the Article associated to the Storage Area contains an attribute named "FulfilmentType". See how we can show this in the Articles list below.Note: This video does not have audio.

Key points

[Warning: empty required content area]

Working with variables attributes by name

You can render images in lists and cards by specifying the component attribute type as "image". This also allows additional options to be provided to the image html that is generated.`{`
`    "type" : "image",`
`    "value" : "{{attributes.byName.imageUrl}}",`
`    "options" : {`
`        "width" : 220`
`    }`
``
Read more about configuring Dynamic Attributes on this page.