# Custom enum / field display value in form

**URL:** <https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850>\
**Category:** Help me!\
**Created:** [November 20, 2023, 2:23pm UTC](https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850 "2023-11-20T14:23:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dscreve](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dscreve](https://community.forestadmin.com/u/dscreve)\
**Post date:** [November 20, 2023, 2:23pm UTC](https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850/1 "2023-11-20T14:23:20Z")

</div>

Hello,

I have dynamic enum in my form :

```javascript
enumValues: async context => {
                        const currentStatus = await context.getRecord(['santanderLoanRequestStatusCode']);
                        switch (currentStatus.santanderLoanRequestStatusCode) {
                            case 'PREVALIDATING':
                                return ['PREVALIDATED', 'PREVALIDATION_REJECTED'];

                            case 'LOAN_CONTRACT_SIGNING':
                                return ['LOAN_CONTRACT_SIGNED', 'LOAN_CONTRACT_SIGNATURE_FAILED'];

                            case 'PLEDGE_VALIDATING':
                                return ['PLEDGE_VALIDATED', 'PLEDGE_VALIDATION_REJECTED'];

                            case 'PLEDGE_VALIDATED':
                                return ['FUND_RELEASED'];
                        }
                    }

```

Is there any way to associate a display value that is different than the predefined code ?

I have the same question for form fields :  
I have this :

```javascript
{
  label: 'numero Dossier',
  type: 'String',
  isRequired: true,
  if: context => context.formValues.Status === 'PREVALIDATED'
},

```

but if I want to retrieve the value, I need to use the label instead of a code :

`context.formValues['numero Dossier'];`

Thanks for your help.

David

---

<div class="post-metadata">

**Author:** ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)\
**Post date:** [November 20, 2023, 2:37pm UTC](https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850/2 "2023-11-20T14:37:06Z")

</div>

Hello @dscreve,

Thanks for your message 🙌

Did you check the widgets that you can use in this [documentation](https://docs.forestadmin.com/developer-guide-agents-nodejs/agent-customization/actions/forms-widgets)?  
I’m pretty sure what you wish to accomplish could be done, through the [Dropdown widget](https://docs.forestadmin.com/developer-guide-agents-nodejs/agent-customization/actions/forms-widgets#dropdown-widget) for instance?

Let me know if you find what you’re looking for.  
Cheers!

---

<div class="post-metadata">

**Author:** ![dscreve](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dscreve](https://community.forestadmin.com/u/dscreve)\
**Post date:** [November 20, 2023, 2:50pm UTC](https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850/3 "2023-11-20T14:50:56Z")

</div>

There’s nothing that explain how to separate value and display value in doc for enum value.

---

<div class="post-metadata">

**Author:** ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)\
**Post date:** [November 20, 2023, 5:31pm UTC](https://community.forestadmin.com/t/custom-enum-field-display-value-in-form/6850/4 "2023-11-20T17:31:47Z")

</div>

Hey @dscreve,

Sorry I misunderstood your request.

I thought you wanted to distinguish value and label on the interface.  
But actually it’s on the code that you wish to distinguish both?

In that case, this is not possible yet, unfortunately.  
I’m pushing your request to our Product team so that it could prioritized in the future.

Thanks for your feedback!  
Cheers.
