Help checkboxes

Display related data from a JSON list in a readable format.

Overview

The issue occurs when a JSON field containing IDs is displayed with brackets and quotes instead of showing the corresponding names from a related table.
First, use a second read data action to fetch the related names using the JSON list. Then, process the JSON data in a PHP block to remove the brackets and quotes, displaying the names as a comma-separated list.

Answered
Connectivity v6
he healyhatman 21 May, 2019
Well does the table Teste have a corresponding entry? Because it looks like it doesn't. What exactly are you trying to do here, and what does your second model in the read data action look like?
ra rafaelscouto 21 May, 2019
I have two tables.

Tab_1 and Tab_2

Tab_1
id, name
1, car1
2, car2
3, car3

Tab_2
id, brand
1, ["1", "3"]
2, ["2"]

I want to relate these tables, and instead of showing the values of the IDs, I want to show the corresponding name
he healyhatman 22 May, 2019
Going to need a screenshot of your read data setup.
he healyhatman 22 May, 2019
So is ciriosidades in your first image a JSON list of selected answers?
he healyhatman 22 May, 2019
Then you need a separate read data after the first that gets foreignkey IN {var.jsonde:read_data1.model.jsonfieldname}

Should probably also set the first read data to first matching unless you're trying to get multiple rows
ra rafaelscouto 22 May, 2019
I can show it on the screen, it looks like this:

["item1", "item2", "item3"]

How do I display it like this:

item1, item2, item 3 ...

Without the brackets and quotation marks
he healyhatman 22 May, 2019
Answer
echo implode(", ", json_decode($this->get("read_data.model.field")));

Whack that in a PHP block or somesuch
This topic is locked and no more replies can be posted.