2

I use DropDowns linked to database columns where values might become outdated, such as people who are no longer Employees, or Printers that no longer exist. For situations like an issue tracking application, how should I deal with cases where a value stored in the database is no longer in the current DropDown list? In ASP.Net the application just "blows up", which is not acceptable.

I came up with two partial options so far:

  1. For Employees, there is a table which retains old values. However, if I want to allow only current Employees to be picked when creating new data, this is awkward. I tried adding an asterisk to the start of old Employee names and sorting those to the bottom of the list. This is a list with two columns: employee ID and Name. The ID is what is stored in the database column of the Issue record, for example.

  2. For Printers, the list has only one column, so I created a "Safe DropDown" User Control that will show the invalid value at the top of the displayed list. It doesn't blow up, and the value is available, but other users do not have it in their list of current Printers (the true list is not updated in any way). This approach would be harder to do with a two column list - what do I show as the 'name' of a missing entry?

I have not seen any guidance about what to do in cases like these. What is the recommended approach where old values must be displayed, but not selected for new records?

6
  • 1
    Much of this question sounds like you're designing the user interface as a result of how the code works. In UX-land, we tend to try and design interfaces in ways that are best for the user, and let implementation details get sorted out later. An illustration, your question 2b ("what do I show as the 'name' of a missing entry") would instead be something like "Is it useful for a user to see the name of employees that no longer work here? Would a user maybe want to know who used to be assigned to x?" If so, then you wind up with an employee table that now sets an isDeleted bit instead. Jun 16, 2021 at 13:27
  • ...so then your user's needs (i.e. you determine is useful to be able to view former employees) end up taking priority, and your code develops to achieve that. Jun 16, 2021 at 13:30
  • @maxathousand Yes, I want to add the isDeleted column to that already existing table, but changing the database structure is a bigger issue than just getting my list to display. Perhaps I can do that sometime, but I can't wait for it when developing what is basically a Proof of Concept application. Why do DropDowns just 'fail' when the selection doesn't exist? Seems pretty drastic. In all these years, no one else solved this trivial problem? Jun 16, 2021 at 13:42
  • The list of Printers is pulled from the Server printer queues, so I can't have any 'historical' / isDeleted in that live list. Thus the SafeDropDown was created. Jun 16, 2021 at 13:46
  • I don’t know what you mean by fails or blows up. That is not the framework blowing up its how the developer programmed it for instance, in asp.net you cannot just set a selected value in a dropdownlist if that value or option does not exist of course it will blow up. But to avoid blowing up you first check does the item exist? If it doesn’t you do not select it and avoid “blowing up”.
    – JonH
    Mar 2, 2022 at 3:52

1 Answer 1

1

This is an interesting question related to interface design but probably should be addressed in the information/data management practices.

What I mean by this is that the two scenarios you mentioned about the values becoming invalid over time should be managed in the business process level and then reflected in the interface. So for example, if you have standard naming conventions for printers, then it should possible to determine if the printer that becomes invalid (for whatever reason) can also become valid again. If not then there is no reason for the value to stay in the database (unless there is some auditing requirement). Therefore you wouldn't display it in the interface either as it serves no real benefit for the user when trying to find a valid printer to connect to.

The same applies to the employee ID and name because it is possible in large companies for employees to have the same first name and last name, but the employee ID may not be something that people are familiar to work with. Often the email address assigned is referenced as well (but it is also a source of confusion), and I can see the need sometimes to distinguish between staff that was working for the company but since it is not often possible or likely that you have to contact them, I would question what benefit is serves to display the information before deciding on how you should display it.

Whatever the decision, I think this is clearly a case where business practices need to align with what the user interface is presenting to the end-user so you can avoid having to make decisions like this without much information.

2
  • Thank you. So Business process should not allow printers to be removed? Should not allow employees to leave and still show the data that applied to them while they were here? The data record stores a user ID number, but the list of all current users will not have their name after they leave. So, just not show any names for data about former employees? I kept the former users in the long list of all employees, but flagged them so that they should not be chosen again in the future for new records. Some of this is intended as historical info: specifically, Personnel actions. They don't expire. Mar 2, 2022 at 16:58
  • @BreakingGnus the design of the interface and the logic should be consistent with the business process, whatever it may be. It just makes your job easier to design and implement the interface if you know what it is. Also, even if information or data is persistent, there's no reason to show it if it doesn't serve an actual purpose or need for the users. The way you are handling it at the moment makes sense as long as it is also applied consistently to other types of data and information of similar nature. Consistency is probably just as important as coherence and alignment to business process.
    – Michael Lai
    Mar 2, 2022 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.