Print array with Repeatableentry, how to?
I stored some data with a repeater in my form and I now want to output the data in a infolist with repeatableentry, but I can't get the data.
The array looks like:
My Infolist
Would be glad if someone could help,please
18 Replies
is “data” a column on the record?
or where is that from
I don't know where that is from, is the default behaviour. Here my Code of the repeater
can you open an issue with a reproduction repo please
start from scratch and only add the minimal amount of code required to reproduce, and a seeder
Will try it, have never done this before
"data is added because of the Block Builder, tested it
i think this would work better with a repeater instead of a builder?
because the infolist doesnt know there are multiple block types either
What do you mean I should remove the Blocks from the form and only work with repeaters?
why did you choose the builder?
Because the Form is more structured and organized
hmm, not sure i understand
you only have one block type?
different blocks with different headings
so how are you rendering those with a repeatableentry when there is only one schema
Ok I dont understand, so it would be better for me to remove the block and only use the repeater and then the repeatableentry should work as expected?
your problem right now is that filament doesnt know you have a data array
so you need to add data. to the field name, or move to a more simple json structure
Yeah sure but how to do that in a infolist/repeatableentry?
well if you get rid of the builder so theres just a repeater, you can keep the same code
and otherwise? is there something like "other_income.data"?
would actually be data.other_income
but you still need to overcome the first layer of repetition
you currently have a builder and repeater, so thats 2 nested arrays
but you only have one repeatableentry
so you'd at least need to wrap the repeatableentry in another repeatableentry called "other_income"
and the nested one would be data.other_income
which would then make the nested fields other_income.0.data.other_income.0.name etc, which is the correct path
Wow thanks for the explaination