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

Lookup A Value Based on a ComboBox Selection

Hi,

 

I have two tables: dbo.Semesters and dbo.Courses.

 

I have an edit form connected to the dbo.Courses data.

 

I have a ComboBox in that edit form to select the correct semester title, and the Items property of that ComboBox connects to dbo.Semesters.

 

What I want to do is select the title of the semster ("Spring 2018") and have that data displayed in the ComboBox, while at the same time populating another text field named Semester ID with the ID from the dbo.Semesters table. The ComboBox is working properly. I just need the text field to autopopulate with the correct ID from the dbo.Semesters table, based on the selection from the ComboBox semester title. I'm thinking I need to have the text field do a Lookup based on the ComboBox selection.

 

How can I accomplish this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
caballar
Level: Powered On

Re: Lookup A Value Based on a ComboBox Selection

The solution was to use a contextual variable. On the ComboBox, I set the OnChange and OnSelect property to UpdateContext({IDVAR: ComboBox2.Selected.AutoID}).

 

Then on the textbox where I want the ID to show up, I set its Default property to IDVAR.

 

 

1 REPLY 1
caballar
Level: Powered On

Re: Lookup A Value Based on a ComboBox Selection

The solution was to use a contextual variable. On the ComboBox, I set the OnChange and OnSelect property to UpdateContext({IDVAR: ComboBox2.Selected.AutoID}).

 

Then on the textbox where I want the ID to show up, I set its Default property to IDVAR.

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 201 members 3,757 guests
Please welcome our newest community members: