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 

So, I'm not really sure what role your text input (DataCardValue2) is playing in this scenario, but it is not really relevant to the ComboBox.

If your ComboBox has an Items property of the SharePoint list, then the combobox will have the entire record to use in any of your formulas.

 

So...go back to your test label and change the Text Property to the following:

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

That should give you results based on the selection in the ComboBox3.

 

As for your trying to assign the formula for your DefaultSelectedItems...yes, you cannot give it the "TA", because at that point, you are telling the default to be a string value.  Your ComboBox is based on records, so it needs a record.  The Lookup function by istelf, without a field designation, will return a record, which is correct.

If you "tell" the combo box the record you want as default, it already knows what to display based on how you defined the display values.  So, defaults should be records when your items are records.  The behaviour you are seeing is correct.

 

_____________________________________________________________________________________
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?

label.jpg

 

@RandyHayes 

 

Hi Randy, so when adding that to my label, it doesn't return anything.

 

Even if it did, you are saying there's no way around the current functionality and I need to leave as is? I wont be able to display the "TA" value (CVM in this case) in my other field (TherapeuticArea) based on my ComboBox value?

 

Thanks!

Highlighted
Super User
Super User

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

@simms7400 

The functionality you are looking for is completely possible.  The issue is that something is different between your fields in the filter.

Here is the real test.  Let's go back to the test we did before.  Put the label on the screen and set the text property to:

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

Then select the "Type 2 diabetes" in the combobox.  That label *should* say true at that point.  I suspect it will not.

Let me know what it does.

_____________________________________________________________________________________
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 

 

Here you go, for some reason it doesn't like the .Value

hello.jpg

Highlighted
Super User
Super User

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

@simms7400 

Arggg...sorry about that, I forgot to change the Value part for your test.  Should have been this:

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

Try that and let me know. 

_____________________________________________________________________________________
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 -

As you suspected, it's returning false.   Can you explain to me what you mean by the differing characters? What causes it and how do we fix?

 

Thank you!

Highlighted
Super User
Super User

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

@simms7400 

So, I've seen this before where, it seems, the character set is somehow not comparing properly.  The best I've seen, it has to do with how the information was originally entered into the list.

My, almost 100%, guess is that it is the spaces that are the issue.

You can confirm that if you have an Alias that is one word (no spaces).  You could change the "Type 2 diabetes" in the test label to whatever that single word Alias is, and then change your ComboBox selection to that single word item.  My guess is that the label will then show true.  But, if you repeat this for anything with a space in it, it will be false.

 

As for getting around it, there are a couple options:

1) Fix the space issue in the list.  This would be a lot of work if the list is long.  You can test this out by going into the list and to the item with the Alias of "Type 2 diabetes" and then re-type the exact same thing over it.  My guess is that then (after you refresh your datasource) that your label will show true.

2) If you can figure out what the actual character is that is causing the issue, then you could try to use the Substitute function on the Alias column to substitute any instance of the "offending" character with a real space.

 

#1 is the best choice, because technically, at this point, you have a list with invalid data in it.

 

I would try the couple of experiments listed above and see if you can narrow it down.

_____________________________________________________________________________________
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 

So I have an update, and it goes back to the "DataCardValue2".

 

If I used this formula, it returns true:

(DataCardValue2.Text="Type 2 diabetes")

So, a little background on this.  The ComboBox artifacts sits within another field, called "IND_DESC". Ultimately, I am setting the "IND_DESC" datacard to whatever the value is for the ComboBox.  I'm doing this by setting the "Default" fied of DataCardValue2 to :

ComboBox6.Selected.Alias

I have placed the ComboBox directly over the "IND_DESC" field to seem like its a dropdown when it's not.

 

yyy.jpg

 

So perhaps we need to be using DataCardValue2.Text instead? What are your thoughts?

 

Highlighted
Super User
Super User

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

@simms7400 
That might be a good workaround if it is working.  Not sure why the characters would be any different in that case, but if it changes with the Combo selection and it works with the formula properly, then I'd go for it! 

I call these a "builder control".  I use this often when I want to keep a formula "under control".  So I will have helper labels that build upon each other to provide a final result.  This could fit into that category.  Not that any of this makes any difference to you...just thought I'd share Smiley Very Happy

So, anyway, yes, if that is working for you then use it.  I will also lock this in my memory for the next time I run across a situation where the characters seem to mismatch and I will experiment with your workaround then.

_____________________________________________________________________________________
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 

 

Okay silly question, where would I put this formula?

 

So, as discussed earlier, I want to add this formula to my "TherapeuticArea" property to return the TA (which in this example would be "CVM").

 

So if I put this formula in the "Default" or "DefaultSelectItems" it doesn't validate:

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

Where am I going wrong? I tried to put in my items property as well but no luck.

 

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

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

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

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!

Top Solution Authors
Top Kudoed Authors
Users online (6,978)