> For the complete documentation index, see [llms.txt](https://ieg4.gitbook.io/onevu-digital-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ieg4.gitbook.io/onevu-digital-platform/onevu-control/data-silos/dynamic-content/working-with-back-office-data/data-item-collections.md).

# Data Item Collections

### **Collections**

&#x20;The most powerful things that you will do in terms of data presentation in OneVu will likely revolve around collections of data.&#x20;

A collection could, for example, be a list of payments, a collection of contact details, a list of all family members, a series of invoices, a list of documents issued etc.&#x20;

In order to be able to show collections of details, we need a different format to enable OneVu to understand that it is a collection. Let’s go back to our data item that had a zero:

```
${TransactionDetail.Payments[0].TransAmount}
```

If we look, we might find that TransAmount is is just one of 9 pieces of data available for every payment made for council tax.&#x20;

Let’s say we wanted to show a list of all payments with these two fields

&#x20;PostedDate - TransAmount

&#x20;I.e. if the last three payments were made on the first of the month for 104.00 we want it to show:

&#x20;01/03/2020 - 104.00

01/02/2020 - 104.00

01/01/2020 - 104.00

How can we do this?

&#x20;Handlebars

&#x20;The way we do this is using a format called ‘handlebars’. Or in lay terms two curly brackets around things.  I.e. {{ Thing }}

&#x20;When working with collections what you need to do first is see where the \[0] is. This is effectively telling you this is a collection.

&#x20;So for:&#x20;

```
${TransactionDetail.Payments[0].TransAmount}
```

We can see the collection is:

&#x20;TransactionDetail.Payments

&#x20;***Because*** the \[0] is after the word Payments.

&#x20;Now we know the name of the collection we need to tell it what to do with that collection. To do this we add an action/rule.

&#x20;What we are trying to do is show the date **each** payment was made and the amount. This is how we do this:

```
 {{#each  TransactionDetail.Payments}}
 {{PostedDate}} - {{TransAmount}}
 {{/each}}
```

&#x20;Basically this is saying for each payment made show PostedDate and TransAmount separated by a hyphen.

&#x20;So if you want view contents in a collection you will use:

```
{{#each Whatever.TheCollectionNameIs}}
```

&#x20;To tell OneVu to retrieve contents from the collection for each row in that collection.

&#x20;You then place the actual name of the field i.e. TransAmount inside double curly brackets. So if we additionally wanted to show the payment transaction description (TransDescription) and payment reference (Reference) we would do this:

```
 {{#each  TransactionDetail.Payments}}
 {{PostedDate}} - {{TransAmount}} - {{TransDescription}} - {{Reference}}
 {{/each}}
```

&#x20;Giving a result like this where there were three payments in the collection:

```
01/03/2020 - 104.00 - Direct Debit - 12347
01/02/2020 - 104.00 - Direct Debit - 12346
01/01/2020 - 104.00 - Direct Debit - 12345
```

&#x20;<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ieg4.gitbook.io/onevu-digital-platform/onevu-control/data-silos/dynamic-content/working-with-back-office-data/data-item-collections.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
