Custom enum / field display value in form

Hello,

I have dynamic enum in my form :

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 :

{
  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

Hello @dscreve,

Thanks for your message :raised_hands:

Did you check the widgets that you can use in this documentation?
I’m pretty sure what you wish to accomplish could be done, through the Dropdown widget for instance?

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

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

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.