appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Select widget should display label instead of value while editing a table cell

Open keyurparalkar opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Whenever a select column type cell is editable and when user actually selects the value from drop down for the cell, then select option's value property is updated in cell's data. It is expected that select option's label property should get updated in cell data.

Steps To Reproduce

  1. Drag and drop a table widget and bind a query to this widget.
  2. Change one of it's column to select type and add select options to it.
  3. Make this column editable
  4. Now try to edit this cell
  5. Observe that selecting an option from the select dropdown sets the cell's data to the value property of select option instead of label

Public Sample App

No response

Environment

Production

Issue video log

No response

Version

Cloud

### Tasks
- [ ] https://github.com/appsmithorg/appsmith/issues/27061
- [ ] https://github.com/appsmithorg/appsmith/issues/27093

Front logo Front conversations

keyurparalkar avatar Aug 09 '23 03:08 keyurparalkar

  1. Whenever a column is set to select, by default we show labels and not values.
  2. For existing tables, since we have created this problem we ensure we don't break their apps. We will give an option called "Display As" as suggested in the original issue and for new select columns, it will be Label and for existing columns, it will be Value.
  3. We make it clear that the computed value here refers to the default value/display value.
  4. We make the select widget changes we did for options in the table and json form as well, create a new issue for this.
  5. When the user has turned on server side filtering, we will ask the user to provide additional details for labels to be shown for cases where we cannot find them in options.
  6. Depending on the "display as" property, we alter the search, sort and filter behavior accordingly.

@keyurparalkar @sbalaji1192

dilippitchika avatar Aug 10 '23 06:08 dilippitchika

@dilippitchika I have raised a new feature request for point 4 mentioned above.

keyurparalkar avatar Sep 07 '23 09:09 keyurparalkar

@rishabhrathod01 you think this is realted to #30074

somangshu avatar Feb 02 '24 09:02 somangshu

Please, prioritize. Wanted to use select in a table visualizing "labels" and using "values". Thank you!

MAL0780 avatar Feb 07 '24 11:02 MAL0780

Hello!

I've created a public app to demonstrate a bug observed in the "gender" column. You can access the app here: https://app.appsmith.com/app/select-in-column-bug/page1-65cee8067b1fda250a586c71?embed=true

The issue occurs when I attempt to edit a cell within this column and select a different option. Instead of displaying the labels "female" or "male", the cell shows the numerical values 1 or 2, respectively. Here's the data structure I'm using for the dropdown options:

[
  {
    "label": "female",
    "value": 1
  },
  {
    "label": "male",
    "value": 2
  }
]

I'm building an app where managers update client cities from a set list. This bug hurts a lot and makes updates with foreign key relations basically impossible.
изображение изображение

Scrafi4 avatar Feb 16 '24 05:02 Scrafi4

Please, prioritize. I have the same problem as [Scrafi4] . Thank you!

AndreeaIAM avatar Mar 05 '24 15:03 AndreeaIAM

I have the same problem. Please, prioritize. Thanks!

neilhanhan avatar Apr 02 '24 02:04 neilhanhan

We had another customer hit this today.

rlnorthcutt avatar Apr 03 '24 15:04 rlnorthcutt

I think we have a duplicate issue here: https://github.com/appsmithorg/appsmith/issues/21993

rlnorthcutt avatar Apr 03 '24 15:04 rlnorthcutt

For context, see this screen shot. If I want to edit a field with a select, then I see the value (an id) as the default, but I can see the label when I'm selecting... but then once it is selected, I see the value again. This takes a very simple and powerful feature of the table, and makes it unusable.

In theory, I could parse the DB data, swap out the ids for the labels, and then try to swap them back again before saving to the DB... but this is incredibly messy. For now, it is best to use a JSON form for the editing, which severely limits the edit capabilities of the table row.

image

rlnorthcutt avatar Apr 03 '24 21:04 rlnorthcutt

Looking forward for a fix :)

bastien-naturavelo avatar Jun 21 '24 10:06 bastien-naturavelo

I would also like this to be worked on. I need my users to be able to select from just the label without seeing the value. Thank you.

awalters141 avatar Jul 02 '24 15:07 awalters141

We have hit this same issue.

magliok-wwt avatar Jul 17 '24 13:07 magliok-wwt

Is this fixed for anyone else? I don't see that this is fixed/updated to v1.32

The table control still initially shows the value from query (the value of the select options in my case), and even after a new selection, the same thing happens and the table goes back to the value. Label is only ever used/shown once you're editing the value.

image

magliok-wwt avatar Jul 27 '24 02:07 magliok-wwt