cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yyc_ryan
Level: Powered On

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
ACC
Level: Powered On

Re: Difficulty with Combobox

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.

 

10 REPLIES 10
Super User
Super User

Re: Difficulty with Combobox

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

yyc_ryan
Level: Powered On

Re: Difficulty with Combobox

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

ACC
Level: Powered On

Re: Difficulty with Combobox

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.

 

Highlighted
ACC
Level: Powered On

Re: Difficulty with Combobox

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
Level: Powered On

Re: Difficulty with Combobox

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
Level: Powered On

Re: Difficulty with Combobox

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
Level: Powered On

Re: Difficulty with Combobox

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.

RConsulting
Level: Power Up

Re: Difficulty with Combobox

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?

BrianR
Level 10

Re: Difficulty with Combobox

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 109 members 4,914 guests
Please welcome our newest community members: