> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/7-komponenty-specjalne/oswiadczenia-statements/oswiadczenia-zasilane-z-uslugi-fedstatements.md). Agents can also search and read this documentation through its [MCP server](https://docs.eximee.com/~gitbook/mcp).

# Statements fed from a service - FedStatements

Component displaying statements

![](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-8a439ba25bc7a088968843acdffc7fcd0b0588c2%2Ffedstatements-01.png?alt=media)

## Component properties

| **Eximee Designer property**                                  | Attribute name in the Source | **Description**                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Grouping statements by requiredness** (section **Styling**) | groupByRequired              | Option for grouping statements into required and not required. If the option is selected, the master checkbox will be visible, and selecting it will affect the selection of required statements. Default value: 'false'. Statement sorting must be done on the service side. |
| **Grouping all statements** (section **Styling**)             | groupAll                     | Option for grouping all statements. If the option is selected, the master checkbox will be visible, and selecting it will affect the selection of all statements. Default value: 'false'.                                                                                     |
| -                                                             | masterCheckboxDescriptionKey | Translation key containing the master checkbox label                                                                                                                                                                                                                          |

{% hint style="warning" %}
Note! If both grouping options are selected: groupByRequired and groupAll, only the Grouping all statements option will be taken into account.
{% endhint %}

> More information about component properties: [Common component properties](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/wspolne-wlasciwosci-komponentow.md)

The list of statements is populated from a service. The service must expose one endpoint whose content is JSON defining the structure of the statements. The JSON object here is an array of statements, where each statement is described by attributes:

| **Attribute**                 | **Description**                                                                                                                                                                                          |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                            | a unique statement identifier that will be returned in the component value. It must be unique among statements on both levels                                                                            |
| content                       | statement content                                                                                                                                                                                        |
| description                   | optional statement description visible when expanded                                                                                                                                                     |
| required                      | statement requiredness, default false                                                                                                                                                                    |
| showMoreTextLabel             | optional attribute allowing the content of the button expanding the statement description or the statement document link to be overridden                                                                |
| showMoreInPopup               | flag indicating whether the statement description should be shown in a popup instead of the default expansion, default false                                                                             |
| subStatements                 | optional list of child statements, described by the same attributes. Allowed only in the top-level statement: the subStatements list inside a child statement is ignored together with its statements    |
| descriptionBelowSubStatements | flag for a statement with child statements: the description is shown under the last child statement instead of under the content, default false                                                          |
| documentSource                | optional name of an external source from which the platform retrieves the statement document, e.g. terms and conditions. The source must be available in the installation, as in the PdfViewer component |
| externalDocumentId            | document identifier in the source `documentSource`. The statement has a document when both attributes are non-empty                                                                                      |
| documentFileName              | optional name of the downloaded file, default `<id>.pdf`                                                                                                                                                 |

## Child statements

* Until the parent statement is selected, its child statements cannot be selected.
* Deselecting the parent deselects the child. Selecting the parent does not select the child.
* The requiredness of a child statement applies only when the parent is selected.
* value contains the ids of selected statements on both levels.

{% hint style="info" %}
Only selected skins show the hierarchy of statements. The remaining skins display statements on both levels as a single list, and the above selection and requiredness rules apply to them in the same way.
{% endhint %}

In the skins that show the hierarchy:

* child statements are indented relative to the parent statement and disabled until the parent is selected,
* master checkbox with the option **Grouping all statements** includes statements of both levels,
* master checkbox with the option **Grouping statements by requiredness** includes required top-level statements together with their child statements; a required child statement of a non-required parent statement remains outside it.

## Statement document

A statement, including a child statement, can have a document from an external source, for example terms and conditions from an organization's document repository. The service identifies the document with attributes `documentSource` and `externalDocumentId`, and the platform retrieves it server-side, just like the document in the [PdfViewer](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/5-dokumenty-i-zaloczniki/podglad-pdf-pdfviewer.md#dokument-ze-zrodla-zewnetrznego).

* In place of the button that expands the description, the statement shows a link to download the document. The description (`description`) of such a statement is not displayed.
* The link label is `showMoreTextLabel`, and without it the translation of key `iew.fed.statements.document.download` (default “Download document”).
* The link is placed under the statement content. In a statement with child statements and the flag `descriptionBelowSubStatements` the link is placed under the last child statement.
* The link also works in an inactive child statement. Clicking the link does not change the statement selection.
* The file name comes from the attribute `documentFileName`, and without it the name `<id>.pdf`. In an application opened in the browser, the link opens a new window where the download starts. In an application embedded as a web component, the file downloads without opening a window.
* The document identifier is not passed to the browser. Refeeding the list of statements from the service changes the document links, and the link from before refeeding stops working.
* When the source returns an error or there is no document in it, the download fails and the application continues to work.

{% hint style="info" %}
Only selected skins show the document link. The remaining skins ignore the document attributes and show the statement as if they were not there.
{% endhint %}

## Example services

Sample output of the service returning 4 statements:

```json
[
    {
        "id": 1,
        "content": "required, without description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "required": true
    },
    {
        "id": 3,
        "content": "required, with description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "description": "Description 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "required": true
    },
    {
        "id": 5,
        "content": "optional, with description in popup Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "description": "Description 5 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "showMoreInPopup": true,
        "required": false
    },
    {
        "id": 10,
        "content": "link in the title <a href=\"http://google.pl\" target=\"_blank\">Link</a>"
    }
]
```

Example of a script service returning the configuration from the above example:

```js
function callService(context) {

    const statements = [
        {
            "id": 1,
            "content": "required, without description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "required": true
        },
        {
            "id": 3,
            "content": "required, with description Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "description": "Description 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "required": true
        },
        {
            "id": 5,
            "content": "optional, with description in popup Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "description": "Description 5 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "showMoreInPopup": true,
            "required": false
        },
        {
            "id": 10,
            "content": "link in the title <a href=\"http://google.pl\" target=\"_blank\">Link</a>"
        }
    ];

    return [{ output: JSON.stringify(statements) }];
}
```

{% hint style="warning" %}
When feeding the component through a script service, the result passed to the parameter `output` should be text containing JSON with a list of statements. Do not return a JavaScript array directly as `output`, e.g. `output: statements`.

Correct format: `return [{ output: JSON.stringify(statements) }];`
{% endhint %}

Sample output of the service returning 1 statement with two child statements

```json
[
    {
        "id": "MARKETING",
        "content": "Consent to marketing contact",
        "description": "Consent can be withdrawn at any time.",
        "descriptionBelowSubStatements": true,
        "required": true,
        "subStatements": [
            { "id": "MARKETING_EMAIL", "content": "email" },
            { "id": "MARKETING_SMS", "content": "SMS", "required": true }
        ]
    }
]  
```

Sample output of the service returning a statement with a document (`documentRepository` is the sample name of the source):

```json
[
    {
        "id": "REGULAMIN",
        "content": "I accept the service terms and conditions.",
        "required": true,
        "showMoreTextLabel": "Download terms and conditions",
        "documentSource": "documentRepository",
        "externalDocumentId": "ABD0083270086",
        "documentFileName": "Service terms and conditions.pdf"
    }
]
```

## Platform translation keys

| Key                                   | Description                                                                                                        | Default value     |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------- |
| iew\.rollable.roll                    | Button label for collapsing the additional statement description                                                   | Collapse          |
| iew\.fed.statements.content.toggle    | Button label for expanding the additional statement description, or showing a popup with this content              | Expand            |
| iew\.fed.statements.document.download | Label of the link for downloading the statement document, when the service does not provide it `showMoreTextLabel` | Download document |

{% hint style="info" %}
Demo application: demoFedStatements
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/7-komponenty-specjalne/oswiadczenia-statements/oswiadczenia-zasilane-z-uslugi-fedstatements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
