cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jvasil
Microsoft
Microsoft

Problem using Lookup method with a value selected in a Combo Box

Hello,
I have a powerapp that creates new items in an SPO list. I need to make sure there are no existing items in the SPO list that already have the same values that the user sets in the PowerApp when creating a new item.
For example I need to make sure there are no items in the SPO list that already have the same Brand, Model, and ColorValue, that the user is inputting into the PowerApp.
In the 2nd screenshot below, you can see I'm using the Lookup method on OnSelect property of the submit button of the EditItem form. It works fine for the Brand and Model datacardvalues because they're both text boxes in the PowerApp and text fields in SPO list
The problem I'm running into is the ColorLookUp Combo box value in the PowerApp
As you can see below, PowerApps wont let me compare "ColorValue" in the SPO List to the value selected in the combo box (DataCardValue11.Selected) .. In addition, it won't let me use the selected value in Combo box in my notification statement.
Anyone know how to address these issues?

 

Jvasil_0-1620162492252.png        

Jvasil_1-1620162514566.png


Code in txt below..

==============================

If(
!IsBlank(LookUp(Carlist, Brand = DataCardValue8.Text && Model = DataCardValue10.Text && ColorValue = DataCardValue11.Selected)),
Notify("An entry containing" & DataCardValue8.Text & " and " & DataCardValue10.Text & " and " &DataCardValue11.Selected & " already exists in the list." & " Please create a unique entry that does not already exist in the list" , NotificationType.Error),
SubmitForm(EditForm1);ResetForm(EditForm1)
)
==============================

1 ACCEPTED SOLUTION

Accepted Solutions

That @rizkyaditya your response led me to use ColorValue = DataCardValue11.Selected.Value) which works!! 

View solution in original post

5 REPLIES 5
mstarc
New Member

Combo boxes use SelectedItems instead of Selected as they allow multiple selection.  If the column in your data source is not a multi-select column, you could use a dropdown instead.  

 

So you would use DataCardValue11.SelectedItems

I tried using DataCardValue11.SelectedItems as well and have the same issue.. 

rizkyaditya
Resolver III
Resolver III

Hello @Jvasil 

 

You can try to use this for combobox

 

DataCardValue11.Selected.ColumnName

 

The column name will be the column which value you want to compare in your syntax (. . .ColorValue = DataCardValue11.Selected.ColumnName)

That @rizkyaditya your response led me to use ColorValue = DataCardValue11.Selected.Value) which works!! 

View solution in original post

Hello @Jvasil ,

 

Glad to hear that can help.

Please mark my answer as solution so the other that maybe have the same problem as yours can find it more easily.

 

Thank you!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,568)