appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.35k stars 3.72k forks source link

[Enhancement] Custom columns in table widget cannot reference other custom columns from currentRow #5090

Open sharat87 opened 3 years ago

sharat87 commented 3 years ago

Description

In the table widget, custom column can refer to other column values of the current row using bindings like {{currentRow.columnName}}. However, when using this to refer to other custom columns, the value always returns null.

Screenshot 2021-06-13 at 21 00 09

If using other computed columns is not supported, then they should be removed from the auto-complete suggestions, or it gives the wrong impression that they can be used.

Steps to reproduce the behaviour:

  1. Drop a new table widget.
  2. Add a new column, the customColumn1, and set it's computed value to {{currentRow.step + 'x'}}. Notice that the values in this column show up correctly.
  3. Now add another column, the customColumn2, and set it's computed value to {{currentRow.computedColumn1}}.
  4. Notice that the value in this column is always empty.

Important Details

vicky-primathon commented 3 years ago

@somangshu Will remove custom columns from auto suggestion. Since both customColumn1 and customColumn2 are function of primary column there definition can be written using primary column itself.

Nikhil-Nandagopal commented 3 years ago

@vicky-primathon @somangshu that is not a good solve. Custom Columns can be used as intermediate values. We should support this or let it live but not remove existing functionality

somangshu commented 3 years ago

@riodeuno this is also related to the custom table column which you were looking into this, Moved this to the needs info pipeline

GreenFlux commented 2 years ago

This feature would really simplify the JS needed to access a value from nested objects. I'm currently trying to pull a date value from order.line_items.properties and display it on the Order. I can easily parse out the date and display it in a table based on line_items but I can't reference that custom column in the parent orders table.

somangshu commented 2 years ago

Thanks for the context @GreenFlux, This is helpful, We are working towards a new version of this widget and we will keep this mind while implementing

rohan-arthur commented 2 years ago

confirming as per this slack conversation and forum this question, that referencing a custom column within itself also doesn't work - Please consider including this in the scope, or create a new issue for this.