# I would like to customize report title in report list (for app forms) by adding fields available in the app form

**URL:** <https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903>\
**Category:** Feature Ideas\
**Created:** [July 13, 2023, 1:36pm UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903 "2023-07-13T13:36:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![morlig](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/morlig/32/2613_2.png) [@morlig](https://forum.communityhealthtoolkit.org/u/morlig)\
**Post date:** [July 13, 2023, 1:36pm UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903/1 "2023-07-13T13:36:55Z")

</div>

**Organization:**  
ICAP, CIP-KENYA

**Organization Type:**  
NGO supporting the Ministry of Health (Kenya) funded by CDC

**What Other Organizations Would Benefit From This Feature:**  
Other organizations using the CHT platform

**UI Feature Description**  
As a developer I would like to add a specific field or two to the report title in the report list so as to allow health care workers to efficiently (at a glance) distinguish between two reports generated using the same app form for the same contact.

**What “Pain Point” Does The Proposed Feature Address:**  
Currently all reports submitted using the same app form for the same contact cannot be differentiated in the report list. To differentiate them one has to click on the report instance and view more information. Imagine doing that for 20 reports before locating the single one you’re looking for.

**Proposed Solution:**  
A good way to solve this would be to list fields one would like to show on the reports list title (report\_list\_fields) as an array in the form.properties.json file (just like hidden\_fields are listed) then avail those fields in the context when report titles are generated.

**form.properties.json**  
{  
“hidden\_fields”: [“outbreak\_label”], \>\>Implemented  
“report\_list\_fields”: [“outbreak”], \>\>Proposed  
“report\_title\_key”: “reports.case\_management.title” \>\>Proposed  
}

**messages-en.properties**  
reports.case\_management.title = Case Management ({outbreak})

**Do you have funding to cover external developers?**  
No

**Do You Have Resources (Designers, Developers, PMs) Available:**  
Yes

 ![CHT-Report #1](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/9/9a58ed1e14fd9105c2ef19353f5841affea978f3.png)

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [July 13, 2023, 9:35pm UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903/2 "2023-07-13T21:35:37Z")

</div>

To add some more context for future discussion, the report “summary” (displayed as the _lower_ field in each item in the left-hand report list) is currently [hardcoded](https://github.com/medic/cht-core/blob/d2593c4f80a98d4a816afd87278d247d2ee9d0f4/webapp/src/ts/modules/reports/reports.component.ts#L243) to the _title of the form_ associated with the report. I do not think there is any way, as of now, to configure this field.

However, @morlig, how close do you think you could get to your desired behavior by using the [`subject_key` configuration](https://docs.communityhealthtoolkit.org/apps/reference/forms/app/#formsappform_namepropertiesjson)? That would let you customize the _upper_ field in each item and can include data from the report itself.

---

<div class="post-metadata">

**Author:** ![morlig](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/morlig/32/2613_2.png) [@morlig](https://forum.communityhealthtoolkit.org/u/morlig)\
**Post date:** [July 14, 2023, 5:54am UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903/3 "2023-07-14T05:54:45Z")

</div>

@jkuester This is what I get when I use the **subject\_key** configuration.

**form.properties.json**  
{  
“title”: “Case Management”,  
“subject\_key”: “report.title.case\_management”  
…  
}

**messages-en.properties**  
report.title.case\_management = Case Management {{patient\_name}}

> > patient\_name is a field in the **app form** for “case management” on the base level (not in a group)

What could I be missing?

**Results of the configs above**

 ![CHT-Report #3](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/e339f2e39eb3697e4194aaf716de406ad41a06e9.png)

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [July 14, 2023, 4:06pm UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903/4 "2023-07-14T16:06:34Z")

</div>

Unfortunately, after looking at this again, I realized I misunderstood this in the documentation: `The translation uses a summary of the report as the evaluation context `. The “summary” does not include all of the report fields, but only a [limited sub-set](https://github.com/medic/cht-core/blob/9a526fb57856e84755bbb6111f50c46027fc59c3/webapp/src/ts/services/get-summaries.service.ts#L76) of mostly special system-populated fields.

_However_, to just include some fixed text (e.g. “Case Management”) along with the name of the contact (the value that is shown by default when the `subject_key` is not set) you could use: `Case Management {{subject.value}}`. Alternatively, if you are not using the `case_id` functionality from the [registration transition](https://docs.communityhealthtoolkit.org/apps/reference/app-settings/transitions/#registration) one work-around for loading custom data from the report is to save the data you want in a `case_id` in the form. Then, you can access that value in the `subject_key` via `{{case_id}}`…

---

<div class="post-metadata">

**Author:** ![morlig](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/morlig/32/2613_2.png) [@morlig](https://forum.communityhealthtoolkit.org/u/morlig)\
**Post date:** [July 15, 2023, 7:28am UTC](https://forum.communityhealthtoolkit.org/t/i-would-like-to-customize-report-title-in-report-list-for-app-forms-by-adding-fields-available-in-the-app-form/2903/5 "2023-07-15T07:28:39Z")

</div>

Thanks @jkuester; adding a calculate field `case_id` in the **app form** with the values that I require `concat(${outbreak_name}, ' > ', ${patient_name})` solved it. Used together with the `subject_key`.

**form.properties.json**

```auto
{
"title": "Case Investigation",
"subject_key": "report.title.case_investigation"
}

```

**messages-en.properties**  
report.title.case\_investigation = {{case\_id}}

**Results**

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/d/d2732c086aea91a570bf4d7a0ca87291445486fb.png)

**Note: This workaround doesn’t apply to the reports card on the patient’s profile page**  
[Edit]

> > I noticed that; in the reports card on a profile, report list subtitles only show sometimes. Still investigating this will create it as an issue once certain.  
> > \<\<

Although I can use conditional cards as suggested by @michael here [Customize report title in report list (for app forms) - #6 by michael](https://forum.communityhealthtoolkit.org/t/customize-report-title-in-report-list-for-app-forms/2901/6)
