F
Filament13mo ago
Horia

Render custom calculated field in a form

I have a form which takes some inputs and based on that inputs (number of persons) I need to calculate some price. Can I do that in a custom view field? How do I inject the current form state in that view? Or some parameters to display?
2 Replies
Dennis Koch
Dennis Koch13mo ago
Yes you can use a View field. I think you can use $evaluate(fn ($get) => $get('your_field')) to retrieve other values.
Horia
HoriaOP13mo ago
Thanks @Dennis Koch , that works at an extent. My price calculation is quite complex, and would help if I could do that in my component, after some state is updated, and display in my view the public field holding the calculated price. But I am not sure if I can do that?
Want results from more Discord servers?
Add your server