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.1k stars 3.68k forks source link

[Bug]: Evaluation fails when keys in the object contains spaces #9284

Closed rashmi-rai closed 2 years ago

rashmi-rai commented 2 years ago

Is there an existing issue for this?

Current Behavior

Evaluation fails when object key contains spaces. This object may returned by a query or can be saved in a JS Object.

For the object

[{
"first name": "Jon",
"last name": "Doer",
"gender": "male"
}]

{{currentRow["first name"]}} fails {{currentRow["first_name"]}} works {{currentRow["gender"]}} works

Steps To Reproduce

  1. Create a dataset
    Omgång: "378",
    Datum: "2021-11-08 12:05",
    Typ: "Så",
    ID: "JS00-VdK-170-048",
    Från: "",
    "Planta 1": "Koriander - Cruiser",
    "Leverantör 1": "Semenco",
    "Antal 1": "40",
    "Varför 1": "",
    "Skörd 1": "",
    "Planta 2": "Mangold - Fireworks",
    "Leverantör 2": "De Bolster",
    "Antal 2": "40",
    "Varför 2": "",
    "Skörd 2": "",
    "Planta 3": "Timjan - English Winter",
    "Leverantör 3": "Semenco",
    "Antal 3": "40",
    "Varför 3": "",
    "Skörd 3": "",
    "Planta 4": "Shiso - Perilla röd",
    "Leverantör 4": "Semenco",
    "Antal 4": "40",
    "Varför 4": "",
    "Skörd 4": "",
    Anteckningar: "",
    rowIndex: "9",
    } 
  2. Save it in JS Object.
  3. Add a table widget
  4. Add a new column, customColumn1
  5. Click on settings of customColumn1
  6. Add {{all_events.data[currentRow.rowIndex]["Planta 1"]}} in data
  7. Evaluation fails and customColumn1 remains blank.

NOTE:

Ref:

Environment

Production

Version

Cloud

shadabbuchh commented 2 years ago

Issue is fixed. Evaluation does not fail when keys in the object have spaces.

https://images.zenhubusercontent.com/275993885/5c655537-17ca-447b-a714-5d10fdc8abae/screen_recording_2022_05_25_at_2_20_51_pm.mov

Moving this to Done.