1

On my UI, user can change data type from drop down menu and enter a value against it. User can also change data type and data value at anytime. Now let’s say, user has selected String data type and entered a string value against it like shown in image below:

enter image description here

Now if user changes data type of this column to Integer, what will happen with the string value? Since Integer type cannot hold string values. Should string value be discarded immediately as data type is changed to numeric or should there be a warning message that your value will be discarded if you continue? (I want to avoid warning message since user can change data types and values quite frequently and this will irritate the user.) Is there any other way to handle this scenario? Can I observe such kind of behavior on any already implemented UI for help? Please guide.

3

Leave the value in there as an invalid state

You should allow users to change the type and still keep what they wrote in value field. They might have clicked the wrong type, or want to copy what they had written. You need to communicate that the value is invalid though so I suggest you indicate this by making the value red:

enter image description here

When the user leaves this screen or dialog, you can still trigger a warning that one field has an invalid value and will be discarded/set to a default value if they proceed. You might even provide three buttons to choose between doing one of these things or to cancel and edit it by hand.

1

To a certain degree, the system can handle the problem itself - if an integer is changed to a string, the number can be converted into a string automatically (in the image above to the string "123"). In this case no user intervention is required.

If a conversion is not possible, there should be a warning message. You say, the user "can change data types and values quite frequently", but will he really change data types frequently if he has already assigned values? I think, if the user has already decided for a value, the probability that he has been mistaken about the type is quite low. In case of a change, a warning message is appropriate as the old value can not be maintained.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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