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?
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
Solved! Go to Solution.
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.
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.
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.
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.
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.
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
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?
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...
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |