cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

How to alias values in a dropdown?

Hello,

I have a series of 8 cascading dropdowns to filter a Collection. I need to alias #6 dropdowns Items because the values are not human-friendly. 

The challenges: 

  1. How do I take the values from the Collection and alias them for the user to select
  2. How do I take the users selection and pass it to the next cascading dropdowns?

Example

  • Collection:
    • Country, State, Status, ZipCode
  • Dropdown 1: Country
    • US
  • Dropdown 2: State
    • WA
  • Dropdown 3: Status
    • X
    • 4
    • $u
  • Dropdown 4: Zip code
    • 98111

In the example above, I want to take the Dropdown 3 values and alias them to something like: 

  • X = complete
  • 4 = incomplete
  • $u = unknown

When the user selects an option, I need Dropdown 4 to use the value to further filter the collection. 

  • Dropdown 4 Items Property: 
  • SortByColumns(
        Distinct(
            Filter(
                colData,
                And(
                    country = dd_country.Selected.Value,
                    state= dd_state.Selected.Value,
                    status= dd_status.Selected.Value,
                )
            ), zipcode
        ),"Result", Ascending
    )
    Any ideas?
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to alias values in a dropdown?

@ericonline 

Always proud!! LOL

 

So, here is what you can change.  Right now you are specifically stating that your DropDown is using statusAlias.  That means that the dropdown will have a datatable with a single column of statusAlias.  You'd have to put a lot more "if"'s in to re-alias it.

What I would suggest is to drop the .statusAlias at the end of the AddColumns in that formula.

Then in the designer specifically set the Value [to display] (in the Properties) to statusAlias.

Now, you will have the full record with each selection.  So, you can reference the statusAlias and the Result (as well as any other column in that source).

So, to reference the Alias -  yourDropDown.Selected.statusAlias

To reference the Result - yourDropDown.Selected.Result

 

This way, no need to put any other logic in since you already supplied it once.

 

Hope that is the ticket!!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
4 REPLIES 4
Super User
Super User

Re: How to alias values in a dropdown?

k. I got half of it.. @RandyHayes would be proud!

  • To display the alias, I used:
    • AddColumns(
          Distinct(
              Filter(
                  colData,
                  And(
                      country = dd_country.Selected.Value,
                      state= dd_state.Selected.Value
                  )
              ), status
      ),
          "statusAlias",
          If(
              Result = "X", "complete",
              Result = "4", "incomplete",
              Result = "$u", "unknown"
          )
      ).statusAlias
    • Now, how do I "realias" the users selection to continue the Cascading Dropdown? Hmmm....
Super User
Super User

Re: How to alias values in a dropdown?

@ericonline 

Always proud!! LOL

 

So, here is what you can change.  Right now you are specifically stating that your DropDown is using statusAlias.  That means that the dropdown will have a datatable with a single column of statusAlias.  You'd have to put a lot more "if"'s in to re-alias it.

What I would suggest is to drop the .statusAlias at the end of the AddColumns in that formula.

Then in the designer specifically set the Value [to display] (in the Properties) to statusAlias.

Now, you will have the full record with each selection.  So, you can reference the statusAlias and the Result (as well as any other column in that source).

So, to reference the Alias -  yourDropDown.Selected.statusAlias

To reference the Result - yourDropDown.Selected.Result

 

This way, no need to put any other logic in since you already supplied it once.

 

Hope that is the ticket!!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Super User
Super User

Re: How to alias values in a dropdown?

Right on @RandyHayes !

Excellent approach. Way simpler than the hack I put together in the meantime (which was to create a conversion Collection then Lookup to that to "realias"). 

@KickingApps just turned me on to the "formula bar result view" (aka Enhanced Formula Bar) and it illustrated what you said very well. 

Wahoo! Happy Monday.

 

Super User
Super User

Re: How to alias values in a dropdown?

@ericonline 

Sweet!!  Glad to help.

And Yes...the new formula bar is very helpful at times.  I just keep forgetting to turn it on Smiley Frustrated

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

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: 363 members 4,533 guests
Please welcome our newest community members: