> For the complete documentation index, see [llms.txt](https://docs.opencityitalia.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opencityitalia.it/stanza-del-cittadino/guida-alla-creazione-dei-servizi-digitali/creare-un-servizio/i-componenti/loggetto-della-pratica.md).

# L'oggetto della pratica

Normalmente l'oggetto della pratica viene creato in automatico e riporta l'id della pratica e il codice fiscale del richiedente.

Nei servizi a catalogo l'application\_subject è già configurato, ma può essere personalizzato.

### Configurare l'oggetto della pratica

Per configurarlo, trascina un campo "Hidden" all'interno del modulo.

<figure><img src="https://4252442743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrdV0mwA7iy2c3I7wu5BX%2Fuploads%2FQFlTTRM6dvgAflK0IkI0%2Fimage.png?alt=media&amp;token=980f0f3b-d435-4cdb-9639-57fae20611f5" alt=""><figcaption></figcaption></figure>

Nella sezione "API" del componente, inserisci "application\_subject" alla voce "Property name".

<figure><img src="https://4252442743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrdV0mwA7iy2c3I7wu5BX%2Fuploads%2FjvBMdnmfwBOifRKLsem0%2Fimage.png?alt=media&amp;token=c5307dc5-259e-445b-acb2-04c7a69c1d12" alt=""><figcaption></figcaption></figure>

Successivamente, accedi alla sezione "Data" del componente e alla voce "Calculated value" inserisci il codice JavaScript per personalizzare l'oggetto della pratica.

<div><figure><img src="https://4252442743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrdV0mwA7iy2c3I7wu5BX%2Fuploads%2FC3aw2GqVfqPiVJ2oOqd8%2FScreenshot%202026-07-27%20alle%2011.07.19.png?alt=media&amp;token=2e02f50c-8118-423e-9351-e043955b2d17" alt=""><figcaption></figcaption></figure> <figure><img src="https://4252442743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrdV0mwA7iy2c3I7wu5BX%2Fuploads%2FwPxR5jir5oUkXCTvdUIW%2FScreenshot%202026-07-27%20alle%2011.08.29.png?alt=media&amp;token=6194845d-67d3-4f07-a1aa-16b48f56857b" alt=""><figcaption></figcaption></figure></div>

### Casistiche

Qui trovi tre casi d'uso per personalizzare l'oggetto della pratica: per il beneficiario, per un figlio beneficiario e per richieste presentate con ruoli diversi.

<details>

<summary>Beneficiario</summary>

Se vuoi inserire nell'oggetto della pratica il nome e cognome del beneficiario, puoi inserire questo codice:

```javascript
let name = data.beneficiary.data.family_name
let surname = data.beneficiary.data.given_name
value = `Richiesta <nome del servizio> di ${name} ${surname}`
```

</details>

<details>

<summary>Figlio beneficiario</summary>

Se vuoi inserire nell'oggetto della pratica il nome e cognome del figlio beneficiario del servizio (selezionato tra quelli presenti nel nested form) puoi inserire questo codice:

```javascript
let child = data.children.data.children.filter(child => child.tax_id === data.select_child)[0]
let name = child.given_name
let surname = child.family_name
value = `Domanda <nome del servizio> per ${name} ${surname}`
```

{% hint style="info" %}
Per selezionare il figlio beneficiario tra i figli inseriti nel Nested Form OC-Figli, vai alla sezione [Configurare logiche avanzate nel modulo del servizio](/stanza-del-cittadino/guida-alla-creazione-dei-servizi-digitali/creare-un-servizio/le-funzioni/configurare-logiche-avanzate-nel-modulo-del-servizio.md#use-case-selezionare-un-figlio).
{% endhint %}

</details>

<details>

<summary>Più ruoli</summary>

Se vuoi comporre l'oggetto della pratica in base ai diversi ruoli del richiedente, puoi inserire il codice sottostante. In questo caso, se il ruolo selezionato è cittadino o delegato, l'oggetto della pratica riporterà nome, cognome e CF del soggetto; se invece il ruolo riguarda il legale rappresentante di un'impresa, l'oggetto della pratica riporterà il nome dell'azienda e il relativo CF.

```javascript
if (
  data.for_whom === "cittadino" ||
  data.for_whom === "delegato" ||
) {
  value =
    "Richiesta <nome del servizio> di " +
    data.beneficiary.data.family_name +
    " " +
    data.beneficiary.data.given_name +
    " (" +
    data.beneficiary.data.tax_id +
    ")";
} else if (data.for_whom === "legale_rappresentante") {
  value =
    "Richiesta <nome del servizio> per " +
    data.legal_entities.data.legal_name +
    " (" +
    data.legal_entities.data.tax_id +
    ")";
}
```

</details>


---

# 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.opencityitalia.it/stanza-del-cittadino/guida-alla-creazione-dei-servizi-digitali/creare-un-servizio/i-componenti/loggetto-della-pratica.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.
