cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Re: Use ComBox to drive the population of other fields?

@simms7400 

I started reviewing all the pieces again and realized I didn't get an answer from you on this:

 

Per your first question, if the user is submitting a new request, I don't want them picking anything. I want the TA DataCard to populate with the TA value in the "RD_Indication_List" based on the value in the ComboBox.

But, you do want them picking something from the ComboBox.  In this case something from the RD_Indication_List...the Alias or something else?  AND...once they pick that, you want the TA value from the RD_Indication_List that is based on their selection to be the value in the TA column of the Investment record?  If that is correct...then the question still remains, do the choices correspond to the value in the TA columns of the RD_Indication_List?  They will need to.

And, one more thing.  I know from your previous posts that you have an IND_DESC DataCard - is there a column in your data for that?  What is it's Default property and, I assume, it is just a text column since it has a TextInput control in it.  You added the Combobox6 control.
You also have a TA DataCard??

 

 

_____________________________________________________________________________________
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.
Highlighted
Post Prodigy
Post Prodigy

Re: Use ComBox to drive the population of other fields?

@RandyHayes 

 

But, you do want them picking something from the ComboBox.  In this case something from the RD_Indication_List...the Alias or something else? 

 

Yes, the ComboBox is a dropdown of all of the values in the "Alias" column of the "RD_Indication_List".

 

And, one more thing.  I know from your previous posts that you have an IND_DESC DataCard - is there a column in your data for that?  What is it's Default property and, I assume, it is just a text column since it has a TextInput control in it.  You added the Combobox6 control.
You also have a TA DataCard??

 

Yes, there is a column called "IND_DESC" in "rdInvestments". "IND_DESC" has a Default property of "ComboBox.Selected.Alias" to pull in whatever is selected in the dropdown.

 

Yes, the TA datacard is what I have on my editform and that data card is a choice field.  Ultimately, per earlier posts, I will also make this field a View only field for new requests since it will be populated based on the ComboBox selection and then determine the TA value from "RD_Indication_List".  Then for change request, i'll switch back to allowing this field to be edit (via drop down).

 

Does that make sense?

Highlighted
Super User
Super User

Re: Use ComBox to drive the population of other fields?

@simms7400 

Okay...so here's how I see it working for you (let's see if I've gotten close yet).

 

You have a ComboBox with a Items list of RD_Indication_List and you are displaying the Alias column in the list.

If it is a New entry, you want this combobox to be displayed...

So, the Visible property of the ComboBox will be :  (Form.Mode=New) 

 

You have a IND_DESC DataCard.  It's default value will be this formula:

If(Form.Mode=New, ComboBox.Selected.Alias, ThisItem.IND_DESC)

The above I'm not clear on completely if you are wanting the IND_DESC to follow the ComboBox selection on a New entry...but, I'll state it anyway.

 

You have a TA Datacard.  I would suggest that it be non-visible during a New Entry as well (Form.Mode=New) only.

Your TA Datacard has (by default since it is a choice field) a ComboBox in it. (this is where we struggled to get the values to match).  The ComboBox has a list of Choices from the TA column, which are identical to the distinct TA values in the RD_Indication_List.  You have added a TextInput control to that datacard.  But, in reality, you don't want people to enter anything in that control.  I would hide it (set Visible=false).  I believe/think that we only have this control there because of the issues you had with matching values.  If we can do away with it, all the better.

The Update property of the TA Datacard should be this formula:

If(Form.Mode=New, ComboBox.Selected.TA, DataCardValuex.Selected.Value)

The above is going to depend a little on the DataCardValuex Items property.

 

Let's see if we are any closer now.  In general, the big thing is to display or hide controls that will only be needed during the New Entry or not, and also to assign the Update properties of the DataCards based on the mode of the form.

 

Let me know if we are getting there now...I do hope so!

_____________________________________________________________________________________
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.
Highlighted
Post Prodigy
Post Prodigy

Re: Use ComBox to drive the population of other fields?

@RandyHayes  Thank you so much!

 

I'm following your reasoning with everything, I'm in agreement.  To start off, before I start hiding fields and what not, I wantt o get the TA field to function as it should, so that is what I am performing first based on your insturections.

 

When I add the formula to the Update field, i'm getting an error:

RANDY.jpg

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

 

Thank you, Randy!

Highlighted
Super User
Super User

Re: Use ComBox to drive the population of other fields?

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Post Prodigy
Post Prodigy

Re: Use ComBox to drive the population of other fields?

@RandyHayes 

 

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS - this now works as expected!!

 

WOW, thank you so muuch, Randy!  

 

I also took the logic and added it to (2) additional fields as well for the "automatic" population.

 

This is fantastic and will cut down EXPOENTIALLY on users choising the wrong values for new data elements.

 

Thank you again, Randy!! If you are in the Boston area, I'd like to buy you a beer, or 4.

 

Highlighted
Super User
Super User

Re: Use ComBox to drive the population of other fields?

@simms7400 

Wowza!!  I knew we would get there eventually!!  So glad we did.  

And, I'll definitely keep you in my list for my next trip to Boston...I could use a beer or 4 after that 😉

_____________________________________________________________________________________
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.
Highlighted
Post Prodigy
Post Prodigy

Re: Use ComBox to drive the population of other fields?

@RandyHayes 

 

Unfortunately, I need to resurecct  this post.  After a successful UAT session with key power users, there has been some feedback on this functionality.  Due to new business requirements, the process needs to change slightly.

 

Right now, the selection of the "Indication Desc" field drives the population of the TA field for new requests..   However, we need to switch it.  Essentially, the end user needs to first make a selection from the "Thereapeutic Area" field. That selection should populate the ComboBox with all "Indication Desc" values for that particular Therapuetic Area.

 

But remember, the "Therapeutic Area" field that the end user will select is connected to the "rdInvestments" SP list. The "Indication Desc" information is in the "RD_Indication_List" SP list. However, the TA field in "RD_Indication_List" and the "TA" field in "rdInvestments" table has the same values.

 

So for instance, if an end user selects "CNS" from the "Therapeutic Area" field, all "IND_DESC" values assosicated with that TA should populate the ComboBox:

 

yes.jpg

 

Just for some background, the "Therapeutic Field" in my EditForm is populated with this for the Update property:

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

Which I believe we'll need to change.

 

And my "Indication Desc" field  Default property is populated with:

If(InvestmentEditForm.Mode=New, ComboBox6.Selected.Alias, ThisItem.IND_DESC)

The ComboBox default select items is populated with:

LookUp(RD_Indication_List, Alias=ThisItem.IND_DESC)

Thank you, Randy. Please let me know if you need any more detail.

 

 

 

Highlighted
Super User
Super User

Re: Use ComBox to drive the population of other fields?

@simms7400 

Ugh...it only took 37 posts to get to the solution before! LOL

 

Okay, so as I see it based on the description, your ComboBox will have all of the values in IND_DESC associated with the particular TA field chosen.  So, based on your picture, there are two CNS TA values.  If the user chooses CNS in the "Therapeutic Area", then the ComboBox should show the two redacted values from IND_DESC in your picture.

 

So, just spitballing a bit...

The Items property of your ComboBox will be:

    Filter(RD_Indication_List, TA=ThisItem.TA)

You will be displaying the "IND_DESC" field.

At a glance, I don't believe anything else needs to change.

Possibly might need to adjust the logic on the default selected...only because now you're dealing with multiple values.

 

Have you attempted to make any adjustments? If so, where are you getting stuck?

 

_____________________________________________________________________________________
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.
Highlighted
Post Prodigy
Post Prodigy

Re: Use ComBox to drive the population of other fields?

@RandyHayes 

 

Hi Randy - so I tried that approach you mentioned already but getting an error as it's not validating:

TA.jpginstead if ThisItem.TA i also tried DataCardValue39.Select which is the datacard of the TA field but same error as well.

 

Any thoughts?

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

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 (10,866)