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.

3 REPLIES 3
Administrator
Administrator

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.

Administrator
Administrator

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 212 members 3,539 guests
Please welcome our newest community members: