Hello,
I changed an existing edit form over from Sharepoint to SQL server datasource. Everything works fine except for every drop down.
I have many drop downs- some with a data source of a table(numeric) and other with choices (text).
The dropdowns load fine when clicked into.
The Default value of each dropdown produces an error now. They all display "Expected Record Value." "This formula uses scope"
Data type is numeric for lookups and text for choices (where I listed the choices in the Items of the dropdown).
Can any offer any ideas? I can't recreate the form as there are days of customizations made to fields. I also can't delete and reinsert data cards as the forms data source is a collection based on SQL server table.
Solved! Go to Solution.
First - Dropdowns and ComboBoxes are two entirely different things. They need to be assigned values properly.
For the DropDown you are showing in the pictures, your default on the DataCard should be:
{Value: ThisItem.BearingTypeODE}
(PLEASE NOTE: The capital V in Value)
Your Default on the Dropdown control in your DataCard should be Parent.Default
You should always observe using the Default property on the DataCard and then referencing it in your datacard controls - this will maintain the Unsaved functionality of the EditForm.
For ComboBoxes, there is a Default property, but it does nothing. For those you need to utilize the DefaultSelectedItems property. The "signature" of the record used in that property will be highly dependent on the items property of the Combobox - and must match in order for items to be selected properly.
You appear to be trying to assign a numeric value to a datacard that wants to have records instead. This is because you are using a ComboBox and the default items for a dropdown needs to be a record.
You would need your Default property to match the type of record that is in the ComboBox.
If you are using Choices, for example, you can also consider changing your Default datacard property to the following:
{Value: ThisItem.MotorMakeID}
However, again, whatever you have in the Value needs to match what is in the items record of the CombBox.
I hope this is helpful for you.
I appreciate the help...
I started with the simple combo boxes- the ones that are 'choice' type. Using {Value:} did remove the error.👍
However the combo box will not display any value. For this record, ThisItem.BearingTypeODE="Ball"- I created a label to test this. Ball is listed in items but will not display. See photos below.
Of the many 'choice' type combos- the only one that is displaying properly with {Value:} is one that I had to change the the default value to a new new field (I changes the field name when migrating data to SQL server).
Thanks in advance- I hate getting stumped like this on simple issues...
First - Dropdowns and ComboBoxes are two entirely different things. They need to be assigned values properly.
For the DropDown you are showing in the pictures, your default on the DataCard should be:
{Value: ThisItem.BearingTypeODE}
(PLEASE NOTE: The capital V in Value)
Your Default on the Dropdown control in your DataCard should be Parent.Default
You should always observe using the Default property on the DataCard and then referencing it in your datacard controls - this will maintain the Unsaved functionality of the EditForm.
For ComboBoxes, there is a Default property, but it does nothing. For those you need to utilize the DefaultSelectedItems property. The "signature" of the record used in that property will be highly dependent on the items property of the Combobox - and must match in order for items to be selected properly.
Using Value with a capital V worked amazing!
I am stuck with one last issue- when I open the form in edit form mode, the MotorMake is selected and displayed as the MotorMakeID instead of MotorMakeDescr.
Any ideas? Below are screenshots. Thanks you 🙂
Yes, you will need to set your Default property to a value that matches a record of your MakeCollection. Not sure of the structure of that collection.
The easiest way to go about that would be to do a Lookup on the DefaultSelectedItems property of the Combobox.
Something like:
LookUp(MakeCollection, MotorMakeID=Parent.Default.Value)
In general, to get an item to be selected, you need to provide that exact item (or table of items) in the DefaultSelecteItems property.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
204 | |
181 | |
68 | |
36 | |
33 |
User | Count |
---|---|
342 | |
274 | |
114 | |
75 | |
58 |