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

Help populating text box based on value of drop down

 Good morning,

I am trying to populate a text box based on cascading dropdown boxes. I have gotten the Cascading Dropdown Boxes to work, but cannot get the text field to populate. I want to be able to select a Community and then the Trade from the community, and the app populate the Trade Name, Contact, Phone Number, and Email.

Any help would be appreciated. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Help populating text box based on value of drop down

Although the names of your description and your table don't align, I will make the assumption that you are trying to get the Company, Contact, Phone Number, and Email fields from your datasource.

 

In that case, the step would be to do a lookup on it:

   Lookup('Comm.Trade', Community=DropDown_Comm.Selected.Value && DropDown_Trade.Selected.Value)

 

I would assign this to a variable to make it easy and would do so in the OnChange action of the DropDown. Something like:

  UpdateContext({selectedTrade:Lookup('Comm.Trade', Community=DropDown_Comm.Selected.Value && DropDown_Trade.Selected.Value))

 

Then for your text boxes:

set the text of Trade Name to selectedTrade.Company

set the text of Contact to selectedTrade.Contact

set the text of Phone Number to selectedTrade.'Phone Number'

set the text of Email to selectedTrade.Email

 

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

1 REPLY 1
Super User
Super User

Re: Help populating text box based on value of drop down

Although the names of your description and your table don't align, I will make the assumption that you are trying to get the Company, Contact, Phone Number, and Email fields from your datasource.

 

In that case, the step would be to do a lookup on it:

   Lookup('Comm.Trade', Community=DropDown_Comm.Selected.Value && DropDown_Trade.Selected.Value)

 

I would assign this to a variable to make it easy and would do so in the OnChange action of the DropDown. Something like:

  UpdateContext({selectedTrade:Lookup('Comm.Trade', Community=DropDown_Comm.Selected.Value && DropDown_Trade.Selected.Value))

 

Then for your text boxes:

set the text of Trade Name to selectedTrade.Company

set the text of Contact to selectedTrade.Contact

set the text of Phone Number to selectedTrade.'Phone Number'

set the text of Email to selectedTrade.Email

 

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,703)