ToolJet / ToolJet/ToolJet

Data not visible on component with valid JS single line code

Open
#10,245 0 comments 0 reactions 1 assignee View on GitHub

@arpitnath is already working on this.

Since Jul 2, 2024.

bug
Dominant language
JavaScript
Stars
40.9k
Forks
5.4k
Avg merge
2d 18h
Merged PRs (30d)
202

Description

Issue Title:

Data not visible on component with valid JS single line code

Description:

When using valid JS single-line code to set data in a component, the data should be displayed correctly without requiring any additional operations. However, the data is not appearing as expected. This issue is observed in both the Table and Listview components.

Version Information: EE LTS-2.50.9.8
Environment:

ToolJet Cloud / Docker / Linux / MacOS

Expected Behaviour:

On all valid JS single-line code, the data should be visible on the component without performing any other operations.

Current Behaviour:

The data is not visible if we are using different js functions are using to get the data dynamically with the help of variables/exposed values

Steps to Reproduce:

Case 1: Table

  1. Add a table and populate it with some data.
  2. Add a row click event to set a variable with the selectedRowId.
  3. Populate the default value of the text input with a value from the row identified by selectedRowId using the following code:
    {{((queries.restapi1.data ?? []).find(obj => obj.id === variables.selectedRowId)?.category ?? "")}}
    
    
    

Case 2: Listview

  1. Add a Listview component inside a tab.
  2. Set a variable from a query (the variable should be nested).
  3. Use the exposed value of a radio button to fetch the data for the Listview dynamically using the following code:
    {{variables.appState.spreadsheet[components.radiobutton1.value] || []}}
    
    
    
Screenshots or Screencast

Video link

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.