I have a combobox in an Edit Form that is connected to a datasource dbo.Students. I can choose the student I want and submit the record fine. But when I open the record to edit other fields, the combobox value is cleared. I have to manually re-enter the combobox selction every time I edit the record, even if I just want to edit another field and leave the previous value for the combobox intact. I've tried changing the Update property of the datacard to something like If(IsBlank(Combobox1) ...... but no combinations of formulas have worked yet.
I would like the combobox to not update or change previously selected values unless I click on it.
Can someone help with this please?
Solved! Go to Solution.
@timl I was able to solve the problem. There is a Default property and also a DefaultSelectedItems property. When I use the Lookup formula in the DefaultSelectedItems property, and leave the Default property empty, everything works as it should. The formula for the DefaultSelectedItems property is LookUp('[dbo].[Semesters]',Semester=Parent.Default)
Thanks for your help!
To configure a dropdown control on an edit form, there are 2 steps to carry out:
Here's an answer that I wrote that provides a bit more guidance. Hopefully, this might be of some help to you.
have you tried using context variables ?
save the combobox selected value in a context variable
set combobox defaultselecteditems value with context variable
update context variable value when combobox changes.
@timl, thanks for your answer. I've tried the Lookup you suggested, but I must be getting the formula wrong. The combobox I am working with is drawing data from dbo.Semesters, which has these fields: Semester, AutoID (auto number and primary key). So the only editable field is Semester.
The formula I tried was LookUp('[dbo].[Semesters]',Semester=Parent.Default)
This only partially works because it returns the same default value for all semester records. For example, I have two records: Spring 2017 and Fall 2017. The formula above only returns the value for Spring 2017, even when I edit the record for Fall 2017.
In your example, there was a period and then "Name" at the end of your formula, but I kept getting errors whenever I would add a period and then choose a selction from intellisense.
Can you provide further assistance? Thanks!
@Sru Thank you for the suggestion. I am not familiar with update context formulas. Can you give an example of what the formulas would look like?
Just to clarify, what value do you want to store in your dbo.Students table? Do you intend to store the numeric AutoID value, or the text value (eg 'Spring 2017' or 'Fall 2017')?
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round