cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Difficulty with Combobox

So I just discovered Powerapps, I'm trying to do a combo box to look up a job number out of a table in an on-premises SQL server.

 

The data source connects nicely. It defaults to display the "AFE" field from my table, which isn't what I want, but at least it's pulling data. Here's what I don't understand:

 

There's a property here called "Value" under the "Items" property. What is this supposed to do? Changing this seems to have no effect on the behaviour of the combobox. I want to display the "ClientJobSAPCode" field, but selecting it here has no effect. Am I missing or misunderstanding something here?

1.PNG

When I set Displayfields to ["ClientJobSAPCode"], I get the items I want in the dropdown. However, search doesn't work properly. It seems to still be searching the AFE field. I reasoned that I should set ["ClientJobSAPCode"] in the "SearchFields" property as well. Problem is, right after I enter that, it changes itself back to ["AFE"]. 

 

I seem to be able to set the SearchFields property to ["AFE", "ClientJobSAPCode"], which causes the combobox to search both of those fields. If I try to again edit this to remove "AFE", leaving only "ClientJobSAPCode", the property changes itself back to just "AFE".

 

This seems like such an odd problem, I feel like I'm missing something fundamental. Any ideas?

 

Thanks,

Ryan

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

I had the same type or problems with Azure DB.  I finally got it to work. I just confirmed this worked for me.

Create the combobox. 

Change the Value field and save.

Type in the value you want for  the Display field and save.

Delete the SearchFields and save. 

Type in the value you want for the SearchFields and save.

 

View solution in original post

10 REPLIES 10
Super User II
Super User II

I had a similar problem using the web editor.  Try doing it in the studio and see if you have the same problem. 

Similar results in Studio, it keeps changing back to the AFE field.

Frequent Visitor

I had the same type or problems with Azure DB.  I finally got it to work. I just confirmed this worked for me.

Create the combobox. 

Change the Value field and save.

Type in the value you want for  the Display field and save.

Delete the SearchFields and save. 

Type in the value you want for the SearchFields and save.

 

View solution in original post

Frequent Visitor

An update to my post.  I found that the Display and Search Fields would revert back to different field after a period of time.  It looked like it was choosing the first field in the table in Alpha order.  In my case I am working a proof of concept so I just renamed the field I wanted for Dispaly and Search  to start with AA.  Looks like it is working.  I will post again if this changes.

Helper II
Helper II

Hi all-the-supporting-members-that-are-outstanding-in-tis-community!

 

I have EXACTLY the same problem. 
When I push the field of "SearchField" I cannot search in the table that I want. Why???

 

The datasource I builton is CDS and I have checked that the field I want to search is ALSO searchable.

So I dont really understand this.


Please help and advice. 

 

1.png2.png

Regular Visitor

I had the same problem. After a couple of jumps against the wall i tried this:

 

1. In OnVisible event of screen load datasource to collection - ClearCollect(myDataSource,'[dbo].[ClientsJobs]')

2. Set myDataSource as Items of ComboBox

3. Set DisplayFields and SearchFields as you need

 

And voila, everything suddenly works.

 

Give it a try.

 

Pavel

Advocate II
Advocate II

I was not able to replicate ACC's fix. However, I was able to fix this by just adding the search field that I wanted as a secondary search field, which worked fine for me. 

 

So, instead of just trying to use ["ClientJobSAPCode"] as the SearchFields property, I would use ["ClientJobSAPCode", "AFE"]. Won't work for everyone, but hope it helps someone.

I'm having this same problem... but with a collection based on a sharepoint list. This seems like a really long-standing bug. Is MS aware of it?

Anonymous
Not applicable

Still a problem on 3.19033.13.  At times it wipes out DisplayMode and SearchMode and replaces with some other field from t he data source.  Appears to happen when you edit the "Items" field.  VERY annoying...  

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (66,146)