cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Dropdown values from entity showing enum names, not labels

Hey guys.

 

I'm working with Dynamics 365 entity and I am trying to display possible options that can be chosen in a dropdown. An issue I ran into which is more about user-friendly side - it is displaying enum technical names from dev side, not the labels. Dropdown is being used to change types and patch it back to entity.

 

Here is an example of how the dropdown options look:

 

Steel
WroughtIron BrushedCopper BrushedSteel AlkalineMetal

 

And here is how I'd like it to look (it looks like this in D365 dashboard since it is displaying labels):

Steel
Wrought iron
Brushed copper
Brushed steel
Alkaline metal

Here is the expression I am using to display the dropdown options to choose from:

DataSourceInfo(D365Entity, DataSourceInfo.AllowedValues, "Metals")

 

Is there a possibility to display the labels instead?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Dropdown values from entity showing enum names, not labels

Hey @TopShelf-MSFT, thanks for looking into this.

An update: I figured out a workaround. I created two dropdowns, one dummy one and one using the entity enums.

In the dummy dropdown I stored intended labels for the enums and in the other were stored the enum names. What I did was make a switch expression that makes corresponding entity dropdown option get selected whenever dummy one option is chosen. Then I simply made only the dummy dropdown with the labels visible.

 

  • Example: "Wrought Iron" in dummy dropdown selected -> "WroughtIron" triggered to be selected in the real dropdown.

Then I was able to patch values back to entity from the real dropdown with no problem, since it still returned back enum value.

View solution in original post

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: Dropdown values from entity showing enum names, not labels

adding in @EvanChakiMSFT to assist with this question

Highlighted
Helper I
Helper I

Re: Dropdown values from entity showing enum names, not labels

Hey @TopShelf-MSFT, thanks for looking into this.

An update: I figured out a workaround. I created two dropdowns, one dummy one and one using the entity enums.

In the dummy dropdown I stored intended labels for the enums and in the other were stored the enum names. What I did was make a switch expression that makes corresponding entity dropdown option get selected whenever dummy one option is chosen. Then I simply made only the dummy dropdown with the labels visible.

 

  • Example: "Wrought Iron" in dummy dropdown selected -> "WroughtIron" triggered to be selected in the real dropdown.

Then I was able to patch values back to entity from the real dropdown with no problem, since it still returned back enum value.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Dropdown values from entity showing enum names, not labels

@Maximilian That's awesome, great work! What lead you to the workaround? @TopShelf-MSFT 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,669)