# Display value of a field as part of a label

**URL:** <https://jsonforms.discourse.group/t/display-value-of-a-field-as-part-of-a-label/1633>\
**Category:** General\
**Created:** [July 30, 2023, 12:19am UTC](https://jsonforms.discourse.group/t/display-value-of-a-field-as-part-of-a-label/1633 "2023-07-30T00:19:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![madla](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@madla](https://jsonforms.discourse.group/u/madla)\
**Post date:** [July 30, 2023, 12:19am UTC](https://jsonforms.discourse.group/t/display-value-of-a-field-as-part-of-a-label/1633/1 "2023-07-30T00:19:05Z")

</div>

I’m new to JSONForms trying to assemble a complex form in Angular.  
Is it possible to display the value of a field as part of a label?  
E.g. If a user selects ‘month’ for participationPeriod, I’d like to change the label to ‘User must qualify every month’.  
Here’s the element in question of the schema:

```auto
"participationPeriod": {
            "type": "string",
            "default": "month",
            "enum": [
              "day",
              "week",
              "month"
            ]
        },

```

Here’s the part of my UISchema:

```auto
{
                  "type": "HorizontalLayout",
                  "elements": [
                    {
                      "type": "Control",
                      "scope": "#/properties/participationPeriod"
                    },
                    {
                      "type": "Label",
                      "text": "User must qualify every '#/properties/participationPeriodStart'"
                    }
]}

```

Thanks in advance.

---

<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:** [July 31, 2023, 7:04am UTC](https://jsonforms.discourse.group/t/display-value-of-a-field-as-part-of-a-label/1633/2 "2023-07-31T07:04:17Z")

</div>

Hi @madla,

You can add a custom Label renderer. The custom Label renderer can use all the utilities JSON Forms provides. In your case you can parse for JSON Pointers and resolve the data like this.

```typescript
const pointer = // analyzed from the string or explicitly handed over separate to the text
const dataPath = toDataPath(pointer);
const data = Resolve(this.jsonFormsService.getState().core.data, dataPath);

```
