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:
Example:
In the example above, I want to take the Dropdown 3 values and alias them to something like:
When the user selects an option, I need Dropdown 4 to use the value to further filter the collection.
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?
Solved! Go to Solution.
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!!
k. I got half of it.. @RandyHayes would be proud!
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
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!!
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.
Sweet!! Glad to help.
And Yes...the new formula bar is very helpful at times. I just keep forgetting to turn it on
User | Count |
---|---|
252 | |
106 | |
96 | |
50 | |
39 |