F
Filament9mo ago
pratik

How to render json column data in table TextColumn

I have call_email json field that holds the data inserted using repeater and array casted in the model :
[{"email": "email@email.com", "phone": "+8798998786xx"}] How to show this data in TextColumn ?
6 Replies
Vp
Vp9mo ago
using TextColumn.. is there any error?
shad
shad9mo ago
did you find a solution? cuz I have the same problem 😓
pratik
pratik9mo ago
@Vp @shad I want to show the email from call_email field. If I use
TextColumn::make('call_email.email')
TextColumn::make('call_email.email')
it shows nothing in the table.
No description
No description
No description
No description
No description
Vp
Vp9mo ago
It seems like we cannot display repeater data with key:value in a table. but only value json data (below) is displayed correctly
// It displayed correctly using TextColumn
["email@email.com", "+87 98998xxxx"]

// this throw error
[{"email": "email@email.com", "phone": "+8798998786xx"}]
// It displayed correctly using TextColumn
["email@email.com", "+87 98998xxxx"]

// this throw error
[{"email": "email@email.com", "phone": "+8798998786xx"}]
@Dennis Koch sorry for tagging here but do you have any solution here.. Objective is to display repeater json data in a table column
Dennis Koch
Dennis Koch9mo ago
Your db column contains an array of objects. So it would be call_email.0.email to show the first one.
pratik
pratik8mo ago
Thank you so much @Dennis Koch @Vp
Want results from more Discord servers?
Add your server
More Posts