Display key-value pair data using a Table component
This guide explains how to use a Table component to display key-value-pair data in the frontend of your applications.
-
Add a Table component to the canvas and update the Table Header to "Table view"
-
Create a backend API with a JavaScript step using the following code:
let data = Table1.selectedRow;
let transformedData = Object.entries(data)
.map(([key, value]) => ({ key, value }))
.filter(
({ value }) => value !== null && value !== undefined && value !== ""
);
return transformedData; -
Add a second Table component to the canvas and update the Table Header to "List view"
-
Update the second Table's Table Data to
{{API1.response}}
-
Add an event handler to the first Table with the action Run API to run
API1
onRowClicked
Now, when you click any row in the first table, you'll see that row's data displayed in the second table in a list form.