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

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Top Community Contributors for September  2019

Top Community Contributors for September 2019 🎉🎉

Let's thank our top community contributors

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

Top Kudoed Authors
Users Online
Currently online: 499 members 5,944 guests
Please welcome our newest community members: