cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Maximilian
Level: Powered On

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
Maximilian
Level: Powered On

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
TopShelf-MSFT
Level 10

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

adding in @EvanChakiMSFT to assist with this question

Maximilian
Level: Powered On

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

TopShelf-MSFT
Level 10

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,513)