cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
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
Highlighted
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,144)