Forums

Help checkboxes

rafaelscouto 21 May, 2019
How do I return the ID names
In the Teste

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?
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
healyhatman 22 May, 2019
Going to need a screenshot of your read data setup.
healyhatman 22 May, 2019
So is ciriosidades in your first image a JSON list of selected answers?
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
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
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.