I Have an editable table which allows users to add their address and delete them. In one of the columns i have "Country" which is a drop down. When adding a new address the drop down defaults to Afghanstan which is the first one in the list. How do i make south africa default when a person clicks new address.

Attached are screen shots. I don't want to add a special list.

Hi, 

When you say drop down, you are talking about a combo box, right? 

The combo box will always have a value selected. If the variable has a Null Identifier, it will set the first item in its list to be the selected one. 

So, the way to make the default selected item selected is to set the variable associated with the combo box to have this country Id. 

The problem is that the Editable table doesn't seem to have an event you could use to do this, upon adding a new line or editing it. 

So, the solution workaround would be to use an aggregate instead of provide an entity to the combo box and order in a way South Africa is the first in the list, what I really don't know if it is possible in an Editable Table (that I Never use), or to follow this approach here (that aí didn't test) : https://www.outsystems.com/forums/discussion/15293/editable-table-add-record-event/

Don't know if there is any other way to make it. 

Cheers 

Thank you so much

Solution

I see the main question is answered but just wanted to add a small elaboration and to confirm that the Aggregation can be used as a source in an Editable Form as well.

I have used a similar technique to have EU countries (the most common selections in my use case by far) listed ahead of all other countries. I added a boolean "IsEU" to the list of countries and the used an aggregate for the ComboBox source. By sorting first on the Boolean and Country name EU countries appear first and then all other countries each group sorted alphabetically. To extend this one could use an integrar instead and assign 1 to the default value, 2 to the group of short listed alternatives and 3 to the rest. That would give a nice usability.

To add to Eduardo's excellect response, I can confirm that it is possible to use an aggregate as the source record list in a ComboBox that is part of an editable form. Just delete the pre-defined SourceEntity and SourceAttribute and the SourceRecordList becomes selectable.

Solution

Thanks for the adding, Mattias. 

It was very helpful. Personally i hate Editable Tables. Too buggy. If they were more stable and free of buggs I would use them more often. 

Cheers