cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

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

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
ericonline
Community Champion
Community Champion

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....

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

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.

 

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,883)