> For the complete documentation index, see [llms.txt](https://docs.guardianservice.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guardianservice.app/technical-information/library-of-policy-examples/trustchain-reports.md).

# TrustChain reports

For a demo example of following steps, here is the policy timestamp: **1675176247.137536341**

### **Task**

Create a report to check a chain of documents.

### **Preparation**

We will use example 4 to assemble multiple documents to build a realistic-looking *Trustchain*.

Let’s add several additional attributes into the documents to simplify the document search.

<figure><img src="/files/50w3Vr8rFKUdr1Fec70J" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lfWSiH2WNTqYUHLc1Iua" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/oGiWHjlABh3JFtl5RGRv" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/QNOki9tEJueIZK8uffnu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/gEeG3EAhjIc4LVXVAcDT" alt=""><figcaption></figcaption></figure>

### **Building the trustchain report:**

1. Using the ‘***reportBlock***’

1.1 Add new container

<figure><img src="/files/PEZXmVghuXbo3o64jqRI" alt=""><figcaption></figcaption></figure>

1.2 Add ‘***reportBlock***’

<figure><img src="/files/FrEQnIU5g7gYQUocg2jt" alt=""><figcaption></figcaption></figure>

In Guardian policy ‘**reportBlock**’ finds VP documents based on their *id* or *hash* and displays document information, related policy and token information. To retrieve the linked information ‘**reportItemBlock**’ must be used.

1.3 We will build the following chain in this example: \*\*mint \*\****VP – MRV Report – Project (approved and signed the the Approver) – Approver document – Project (created and signed by the user) – User document.***

We will need 6 ‘**reportItemBlock**’ items correspondingly, 1 per each document.

<figure><img src="/files/Wpp8psK2CKLm6rK3WBWg" alt=""><figcaption></figcaption></figure>

The ‘**reportItemBlock**’ items are executed sequentially, thus in the filter for each consecutive ‘**reportItemBlock**’ we can use values from the previous blocks/documents.

1.3.1 ‘**mint\_document**’. To find this document which described the token mint operation we will use one of the **Common Variables** - *actionId*

<figure><img src="/files/CLzfV931BMlpUrqgSgBa" alt=""><figcaption></figcaption></figure>

1.3.2 ’**report\_document***’*. To find the MRV report (i.e. data document which was the basis of the decision to mint tokens) we will also use one of the **Common Variables** – *documentId*

<figure><img src="/files/zjcO2mB3u5xcjV1QNC6e" alt=""><figcaption></figcaption></figure>

To find further documents we will need to use values from the **Ref** variable which point to the previous document. Let’s save in a new variable:

<figure><img src="/files/jnC8aOTHpCWdHnlU2TME" alt=""><figcaption></figcaption></figure>

1.3.3 ’**project\_document(approver)***’* - Lets use the previously defined variable alongside the static filtration parameters.

<figure><img src="/files/vai2ajF0nw7e8sjJxEFW" alt=""><figcaption></figcaption></figure>

Save the author of the document signature so we can display the information about the user later

<figure><img src="/files/rd2aVi2ae7az1WXjTgdl" alt=""><figcaption></figcaption></figure>

**Use the same approach to continue the chain until the end.**

1.3.4 ***’*****approver\_document*****’***

<figure><img src="/files/Z4WN1jV2JRdduHcBwBZt" alt=""><figcaption></figcaption></figure>

1.3.5 ’**project\_document(user)***’*

<figure><img src="/files/HaWDrHhyAtTPwmh3qfff" alt=""><figcaption></figcaption></figure>

1.3.6 ’**user\_document***’*

<figure><img src="/files/Rlc3c3lBC2vAiNeH8QfI" alt=""><figcaption></figcaption></figure>

2. To activate the ‘**reportBlock**’ an id or a hash of the VP document is needed, we will add the grid containing the list of the VP documents and links to the trustchain.

2.1 Add ‘**interfaceContainerBlock**’, ‘**interfaceDocumentsSourceBlock**’ and ‘**documentsSourceAddon**’

<figure><img src="/files/y67bXo8C6jpouRvpd0Uu" alt=""><figcaption></figcaption></figure>

2.2 Add new column with the type **BUTTON**

<figure><img src="/files/mVUNIRdc2ZSXa3fhMl8r" alt=""><figcaption></figcaption></figure>

Setting the **Action** to LINK will cause the Policy Engine to attempt to switch the display to the target policy block upon the user clicking the link (if possible).

### **Demo**

#### VPs:

<figure><img src="/files/WJIoMgdDlcub8Ih7Jzva" alt=""><figcaption></figcaption></figure>

#### Trustchain:

<figure><img src="/files/u4erIi1ZyvatfBj3ruMC" alt=""><figcaption></figcaption></figure>
