cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AD1
Regular Visitor

How to pass text selected from a drop-down list onto other screens of the app

Hi everyone,

 

I'm quite new to using PowerApps and wanted to find out how to pass text selected from a drop down list onto other screens of the app so the user does not have to enter this manually each time. So as the image shows below, when the user selects the 'Product' from the drop down list on the first screen, it should automatically pick up this text and display on the other screens as they progress on to different sections. It's needed because each screen is linked to a different SharePoint list based on the information they are filling out about that product and so it automatically populates those fields on there. Any help on how to approach this would be appreciated!

 

AD1_0-1650550099370.png

7 REPLIES 7
zmorek
Super User
Super User

OnChange, set it to something like:

 

Set(varDropdown, Self.Selected.Text)

 

You might need to do something like Self.Selected.Result/Value, depending on your drop down.

 

Then you can reference varDropdown where ever you need.

rubin_boer
Super User
Super User

hi @AD1 you can pass it as a variable in the navigate function or set the variable on the OnChange function of the combobox based on your particular use case.

 

Passing variable with navigate

Navigate(yourScreen,None,{varThisValue: yourCombobox.Selected.Value}),

add a label to yourScreen and set its Text = varThisValue

 

Set a global Variable

On the Combobox OnChange = Set(gblThisValue,yourCombobox.Selected.Value)

add a label to yourScreen and set its Text = gblThisValue

 

Both these will display the selected combobox item on the labels

 

Result

Peek 2022-04-21 16-31.gif

Hope it helps,

R

RandyHayes
Super User
Super User

@AD1 

Controls in PowerApps are global in scope, so they can be accessed from anywhere in your app without making redundant variables.

 

Simply reference your combobox on the other screens.  i.e.  yourCombobox.Selected.<columnNameHere>

 

I hope this is helpful for you.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Thanks everyone. That's really helpful, I was able to get the text passed onto the different screens from what the user selects on the initial drop down list for 'Product'. I forgot to mention there is a collections function being used to save the information the user inputs on the different screens onto the associated SharePoint list. Is there a way to make the 'Product' text that is passed on to the different screens dynamic and get it added to the SharePoint field 'Product' on each list? I tried adding the code mentioned below onto the 'Product' drop down list when you 'Get data' from the SharePoint list and it didn't work. But was able to get it passed onto the different screens as static text with the suggestions above.

 

AD1_0-1650561300453.png

 

zmorek
Super User
Super User

In doing this though, doesn't that cause the app to render that whole screen in the background/cause that to show up as a cross-screen dependency in the App Monitor thing?

@zmorek 

Not really a concern.  PowerApps reports potential performance warnings when referencing a control on another screen because in order to determine its value, it has to render that control first.  I've never experienced any hint of performance issues with that method first off, but in this particular case...that dropdown has already been rendered - there is no additional rendering needed for the value.  It is now global in scope and available anywhere.

 

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Thanks man!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,021)