cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Resolver II
Resolver II

Saving the index of a dropdown selected value to local variable or hidden label

@RandyHayes You brought up an interesting point in my other ticket.  So I thought I'd open this for an explanation.  When the dropdown items are filtered as they are below...All the resulting columns from that view are still usable.

tonykiefer_0-1636052884694.png

 

So the resulting dataset for the dropdown list is this.  The dropdown list displays the PLM_BOM_RESULT.

tonykiefer_1-1636052993405.png

 

If I selected the 4th record in the dropdown...

Component_Change_Combobox

tonykiefer_0-1636053760518.png

and If I wanted to preserve the "Seq" or AX_ItemID and save it to a local variable or hidden label from that selection...How would that look?  

 

When you mentioned this is my previous ticket I had an "Ah Ha" moment and this made me realize a cool feature down the road in my development.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@tonykiefer 

Well, you really don't need to put it in some variable....it is already there!

 

At ANY point that you want, you can reference Component_Change_Combobox.Selected.Seq or Component_Change_Combobox.Selected.AX_ItemID and it will have the value you want.

 

Adding it to a variable means you need to manage that variable all the time because it is a snapshot and will not change on its own.

Adding it to a hidden label is a waste because that would just reference the combobox to then reference the label.  Cut the middle-man and just go to the combobox selected column value you want at any time.

 

_____________________________________________________________________________________
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
RandyHayes
Super User
Super User

@tonykiefer 

Well, you really don't need to put it in some variable....it is already there!

 

At ANY point that you want, you can reference Component_Change_Combobox.Selected.Seq or Component_Change_Combobox.Selected.AX_ItemID and it will have the value you want.

 

Adding it to a variable means you need to manage that variable all the time because it is a snapshot and will not change on its own.

Adding it to a hidden label is a waste because that would just reference the combobox to then reference the label.  Cut the middle-man and just go to the combobox selected column value you want at any time.

 

_____________________________________________________________________________________
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

tonykiefer
Resolver II
Resolver II

@RandyHayes quick and easy!  That's the way I like it.  This is a great little tidbit that I am partially aware of in that I know I can access the datapoint as such Component_Change_Combobox.Selected.Seq...but KNOWING that I can use it later on the page (I'm assuming the page hasn't refreshed and the value is infact cached, somewhere) is a valuable learning point.  You should make a quick little video on this.  Viewers will dig it for sure!  It's the little things like this that are eye-poppers.

tonykiefer
Resolver II
Resolver II

@RandyHayes ...it's an eye-popper because you could then use that datapoint to drive values in other fields...like a cascading dropdown list for instance.

RandyHayes
Super User
Super User

@tonykiefer 

It is actually more than that...it is global.  You can access that value from anywhere in your App!  Controls are global.  So, if you have another screen and want to reference something about that selected Item, you can do so.

 

Yes...I actually have some simple tips and tricks videos on my video's to make list.  I've been way behind on them *sigh*  I just need more time in every day!

_____________________________________________________________________________________
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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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