cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Post Prodigy
Post Prodigy

Use ComBox to drive the population of other fields?

Hi Folks -

I have a form that end users leverage to create new data elements for our Master Data Management system.

 

I have a ComboBox called "ComboBox3" that is populated using a different source ("RD_Indication_List")  than what the Editform uses ("rdInvesments").

 

The other fields I need to populate are "TherapeuticArea" and "Business Owner", which are also located in the "RD_Indication_List" table.  The caveat is,  "TherapeuticArea" and "Business Owner" are also columns in the "rdInvestments" source as Choice fields.

 

My intention is to use a lookup formula to populate to how the business wants them to be set (using the values in "RD_Indication_List"), but they have the ability to overside using dropdown.

 

Additionally, the value in the ComboBox that they select corresponds to the "Alias" column in "RD_Indication_List".  THerefore, from my "TherapeuticArea" field in the "Default" section, I'm trying to add a formula to look at the ComboBox value and then return the value from the "TA" column in "RD_Indication_List".

 

yesss.png

 

yes.png

So per my above screen shot, it should return "CVM".

 

I tried a lookup formula but doesn't seem to validate.

LookUp(RD_Indication_List, lias=ComboBox3.Selected.Value,TA)

It's probably something simple I'm missing. Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions

@simms7400 

Closer....

Let's change the Update property on the TA DataCard to the following:

{
Value: If(Form.Mode=New, ComboBox.Selected.TA, DataCardValuex.Selected.Value),
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}

Sorry, forgot the TA column was a choice (even though I wrote that it was)...go figure!

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

@simms7400 

Yes, I see the Business Owner as a ComboBox in a DataCard on your Edit Form - BUT, I have never seen that in all of our discussions to know what kind of field it is.  You state it is a Choice field, so this brings us back to that usual scenario of "do the choices match the values in the Indications list"?

If so, then we need to supply a record to the default, and in this case, we'll change the DefaultSelectedItems to:

If(InvestmentEditForm.Mode=New, {Value:ComboBox6.Selected.Business_Owner}, Business_Owner)

This will convert the Text value in the Business_Owner combobox selection (remember it is coming from the Indications table as such) to a record that SHOULD match what is coming from the data source rdInvestments.  That is, unless you have changed the Items property of this particular datacard/combobox.

 

Let's see if that gives some joy.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

54 REPLIES 54
simms7400
Post Prodigy
Post Prodigy

LookUp(RD_Indication_List, Alias=ComboBox3.Selected.Value,TA)

Sorry, I had a typo from my post...THe above formula doesn't work in my app based on requirements. Thank you for all your help!

@simms7400 

I would take the first troubleshooting technique of putting a Label on your screen and setting the Text property to:

LookUp(RD_Indication_List, Alias="Type 2 diabetes",TA)

See if that returns anything - it should. And your label should be "CVM"

If it doesn't then try this in the label:

LookUp(RD_Indication_List, Name="IND-00050",TA)

That should return something.

 

If the first one returns something, then you might be looking at a mismatch of characters.  

Change your Label Text property to:

(ComboBox3.Selected.Value="Type 2 diabetes")

That label *should* then show "true" when your combobox is set to that value.  If it doesn't, then you are looing at character issues.

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes  Thank you for the suggestions!

 

So happy to report, the following works and returns "CVM":

LookUp(RD_Indication_List, Alias="Type 2 diabetes",TA)

 

But I try to use this Lookup, it doesn't recognize it:

 

LookUp(RD_Indication_List, Alias=ComboBox3.Selected.Value,TA)

It high lights the .Value peice and the error is "Invalid argurment type.

I tried .Alias but no luck.

 

I'll keep trying some other things...

@simms7400 

So what is the Items property for your ComboBox?

This sounds like a mismatch on the data.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes  Okay another update!

 

The following code works on my test Label!

 

LookUp(RD_Indication_List, Alias=DataCardValue2.Text,TA)

DataCardValue2 what is what is connected to the ComboBox3 (ComboBox6.Selected.Alias)

 

However, when I try to add the working code to my "TherapeuticArea" field, in the "DefaultSelectItems" spot, the error messgae is:

"The property expects table values, but this rule produces incompatible text values."

 

Is the issue because my TherapeuticArea field is a choice field?

 

Thanks!

@simms7400 

You have to provide the proper types for properties.  A DefaultSelectedItems property expects a table.  So, you can't give it a string.  It needs to be a table of any records/items that match the signature of the Items property of the control.  

So, what is the formula for the Items property of your ComboBox3 control?  This is the only factor that is causing you problems at this point.  

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes 

 

Hi Randy -

 

The items field in my ComboBox is "RD_Indication_List" which is a SP table.  Furthermore, I'm displaying the "Alias" column in my ComboBox from "RD_Indication_List".

 

Thanks!

One more piece, the "DefaultSelectedItems" in my ComboBox is:

LookUp(RD_Indication_List, Alias=ThisItem.IND_DESC)

yup.png

 

Furthermore, if I put the following formula in the ComboBox "Default" section it validates:

LookUp(RD_Indication_List, Alias=DataCardValue2.Text)

But as soon as I add ",TA" it fails.

@RandyHayes 

 

I'm sorry, for the following:

Furthermore, if I put the following formula in the ComboBox "Default" section it validates:
LookUp(RD_Indication_List, Alias=DataCardValue2.Text)

I meant the TherapeuticArea field, not ComboBox.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,975)