Display an Array in Ccv6 table

Display an array stored as JSON in a CCv6 table without brackets and quotes.

Overview

The data is saved as a JSON-encoded string, which displays with its original formatting.
Disable auto-save options, use a data override to join the array values with a comma for display, and use a split function to read the data back for editing.

Answered
Connectivity v6
Elita- Elita- 24 Apr, 2020
Hello to all CCv6 guru,
Simple question that I cannot resolve myself-
I have an Array that is stored in the Database like this - ["A","apm","Apm.","Aud"] in one Column named pakalpojums.

When I create a table in CCv6 I got the same view. in a column named Pakalpojums.

So, what should I do to have those data to be nicely represented in the table without square brackets and quotes - A,apm,Apm.,Aud?

Thank you in advance -
Elita
Elita- Elita- 24 Apr, 2020
and more - how can I read back those values for edit in Dropdown Multi Select?
Gr GreyHead 25 Apr, 2020
1 Likes
Hi Elita,

It looks as if your data is JSON encoded for saving, so you'd need to decode and re-format it into the display that you need.

Bobb
Elita- Elita- 25 Apr, 2020
Thank you, GreyHead, that was the case - I was using Autosave option Max wrote.
To have that data stored and then read as I wanted I did following:

1) created dropdown with multiselect and the name produkts[] - square brackets at the end;
2) untoggled Auto save fields and Auto manage the data table options for DB save Action
3) created data override entry as produkts: {data.join[, ]:produkts};

With this I have data nice presented in the table Column "Produkts" with comma - A, apm, Apm., Aud.

To read this data back in the dropdown for data editing I used {var.split[, ]:read_submission.Submission.produkts};

Works like charm - *love* CF6 and CCv6
he healyhatman 26 Apr, 2020
Answer
{var.jsonde:read_data_action.model_name.field_name}
This topic is locked and no more replies can be posted.