cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HuseyinAhmet
Level: Powered On

PowerApps, display selected type from dropdown?

Hello,

I am trying to make it so that when an item is selected its value will be put in the highlighted box. for example, the code for the box displaying "Alexandrite Dragon" simply says ThisItem.NAME

if dropdown3.Selected.Value is also NAME, why wont the highlighted box also do this with the shown code I have used?

if the code for the highlighted box is just "Dropdown3.Selected.Value" then all boxes will display "NAME"

 

jTqYds.jpg

 

https://i.snag.gy/jTqYds.jpg

7 REPLIES 7
Power Apps Staff murali
Power Apps Staff

Re: PowerApps, display selected type from dropdown?

PowerApps expression language is strongly and statically typed meaning the types should be known statically (ThisItem.(Dropdown3.Selected.Value)) would mean we will know which field and hence the type only at runtime.

 

If you could tell us what you are trying to achieve, we may be able to guide you in the right direction.

 

Thanks

Murali

HuseyinAhmet
Level: Powered On

Re: PowerApps, display selected type from dropdown?

Hello

 

What I am trying to do is make it so that when something from the drop down is selected, eg NAME, the value of NAME for that object is displayed.

 

For example, the objects in my datasheet have values "NAME" "ATK" and "DEF"

 

Ideally when "ATK" is selcted from the dropdown, the objects in this list should have their ATK value in the lower box.

HuseyinAhmet
Level: Powered On

Re: PowerApps, display selected type from dropdown?

So I'm going to send another reply that might better explain what I want.

 

 As you can see above the card soul tiger is selected, and my dropdown search contains the word ATK, if I go to more information:

Soul tiger has a number of values, one of them being ATK.

 

What I am asking is, can I change the text on the first picture from "Click arrow for more information" to display the value of soul tigers ATK when ATK is selected in the dropdown, the value of DEF when DEF is selected ect, and for this to be for all objects in this list.

 

 

HuseyinAhmet
Level: Powered On

Re: PowerApps, display selected type from dropdown?

In the two below pictures I have a text field called "Click arrow for more information" In this instance I would want it to show the value of ATK for all cards, since ATK is selected in the dropdown, and DEF if DEF was selected ect.

Highlighted
Power Apps Staff murali
Power Apps Staff

Re: PowerApps, display selected type from dropdown?

Instead of hardcoded "Click arrow for more information", you can do do "Display the value of soul tigers " & Dropdown1.Selected.Value

 

Replace Dropdown1 with the name of the dropdown control you have.

 

Hope this helps.

 

Murali

 

 

HuseyinAhmet
Level: Powered On

Re: PowerApps, display selected type from dropdown?

Thats not exactly what I want.

 

Your solution would end up making that say:

 

"Display the value of soul tigers ATK"

 

I'm trying to make it do something like 

 

"Soul Tigers ATK is 0"

 

usually this would be done by doing:

 

"Soul Tiger's" Dropdown1.Selected.Value "is" ATK

 

Now that would be great, but i want the bolded value to change with the dropdown, for example if the dropdown was sent to DEF i'd want it to say:

 

"Soul Tiger's DEF is 2100"

 

so if that better explain things I want the final value in the sentace to change to the value of the selected item.

 

 

Power Automate Staff audrieg
Power Automate Staff

Re: PowerApps, display selected type from dropdown?

Hi HuseyinAhmet!

 

Looking at your question it appears your dropdown is populated with the list headers/field names, and that you want it to return the field values for the header selected (and for the current gallery item). The challenging part of your question is really how to use the headers as a variable so we can use it to lookup the corresponding value. I think you ask great questions 😉 so I gave it a try...here is what I did:

 

I opened one of my list apps and created a dropdown (at the top to the right of search), that has 3 headers in it: Code, Category and Title. I just created that dropdown to give me a "header" value when selected and I named it ddHeader (after the fact I added a {Header: ""} in the front because I don't like preselection):

 

Table({Header:"Code"},{Header:"Category"},{Header:"Title"})

Headers.PNG

 

It's important to note that in my list "Code" and "Title" are text string values, and "Category" is a choice list. (Choice lists are returned slightly differently as you'll see later in this post.)

 

 

list.PNG

In this case I use "Code" just like you used "ATK" above.

 

Now because I only have three headers in there, I could use a simple IF/THEN nested statement on a textbox 'text' property where I want the result to be (highlighted in red in all the screen shots below):

If(ddHeader.Selected.Value = "Code", Code,
 If(ddHeader.Selected.Value = "Category", Category.Value,
 Title))

 

designview.PNG

 

 

here it is running with the 'Category' selection

 

categoryselection.PNG

 

here it is running with the 'Title' selection

 

stitle.PNG

 

Cons:

If you have more than 3 choices, then the nested formula could get a bit hard to read (so I suggest separating the lines as I did above). Also, if your headers change, this formula will not update automatically.

 

Tell me if these works for you in your current scenario. If not, I will post another option for you. Smiley Happy

 

 

 

 

 

 

 

 

 

 

 

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,975)