cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yyc_ryan
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
Anonymous
Not applicable

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
Drrickryp
Super User
Super User

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.

Anonymous
Not applicable

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.

 

Anonymous
Not applicable

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.

gog
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

PD
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

larspeterson
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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,217)