# Change the field used for the heading of a group?

**URL:** <https://jsonforms.discourse.group/t/change-the-field-used-for-the-heading-of-a-group/1048>\
**Category:** General\
**Created:** [September 28, 2022, 8:54am UTC](https://jsonforms.discourse.group/t/change-the-field-used-for-the-heading-of-a-group/1048 "2022-09-28T08:54:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![glennpierce](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/glennpierce/32/380_2.png) [@glennpierce](https://jsonforms.discourse.group/u/glennpierce)\
**Post date:** [September 28, 2022, 8:54am UTC](https://jsonforms.discourse.group/t/change-the-field-used-for-the-heading-of-a-group/1048/1 "2022-09-28T08:54:45Z")

</div>

I have some json like

> **[ExampleJson - Pastebin.com](https://pastebin.com/8vDTp0vt)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

It is some nested json objects

site\_groups → sites → equipment → points

I am using the default uischema generated like

```auto
{
    type: "VerticalLayout",
    elements: [
      {
        type: "Category",
        label: "name",
        elements: [
          {
            type: "Control",
            scope: "#/properties/site_group",
          },
          {
            type: "Control",
            scope: "#/properties/outputs",
          },
        ],
      },
    ],
  };

```

This displays ok except for the titles of the groups are wrong.  
For example the points are displayed with the title in the dropdown of “unsigned int”  
presumably because that was the first string field defined in the json ?

How can I changed the field used for this to the dis or name fields ?

Thanks

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [September 30, 2022, 9:48pm UTC](https://jsonforms.discourse.group/t/change-the-field-used-for-the-heading-of-a-group/1048/2 "2022-09-30T21:48:34Z")

</div>

Hi @glennpierce,

You can use the [“elementLabelProp” UI Schema option](https://jsonforms.io/docs/uischema/controls#label-for-array-elements-elementlabelprop) on a control for an array to use a different property than the first one within the JSON Schema.

* * *

Some notes:

- Do you also auto generate the JSON Schema?
- I’m a bit confused about your UI Schema. In the pasted example JSON `site_group` and `outputs` are on two different levels, so they should not have the same scope prefix.
- The element “Category” should only be used within “Categories”, you probably want to use a “Group” there.
- If you need to set a detail UI Schema then you can do so for example via the UI Schema options detail, e.g.

```auto
type: "Control",
scope: "#/properties/sites",
options: {
  detail: {
    type: "VerticalLayout",
    scope: "#/properties/equip",
    options: {
      detail: {
        // etc.
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![glennpierce](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/glennpierce/32/380_2.png) [@glennpierce](https://jsonforms.discourse.group/u/glennpierce)\
**Post date:** [October 4, 2022, 8:22am UTC](https://jsonforms.discourse.group/t/change-the-field-used-for-the-heading-of-a-group/1048/3 "2022-10-04T08:22:52Z")

</div>

I generated the Jsonschema from my json config using an oline service. I then manually entered an couple of area where enums were needed.

I grabbed the UISchema that the code generated. Perhaps I changed the json after grabbing the uischema. I had to move to another project for a while so possible I got lost in what I was doing.

Thanks
