cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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

Highlighted
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

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 361 members 4,985 guests
Please welcome our newest community members: