© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
29 replies
Bagus A

Accessing Form State

I am having difficulty to understand how to access form data in Form Builder.

Let say I have this form and I want to generate part code and part description automatically based on other form fields.

What I'm thinking right now is adding
afterStateUpdate
afterStateUpdate
to every fields and trigger a method to generate the part code. But, inside
afterStateUpdate
afterStateUpdate
I only have access to it's own field state not the entire state.

If I try to use $this->form->getState() it doesn't work, (is it because it's a static function?).

                    ->afterStateUpdated(function (Set $set, $state) {
                        $set('part_code', OrderResource::generatePartCode($state));
                    }),
                    ->afterStateUpdated(function (Set $set, $state) {
                        $set('part_code', OrderResource::generatePartCode($state));
                    }),
Screenshot_2023-11-02_at_12.52.15.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Accessing form data in suffixAction form.
FilamentFFilament / ❓┊help
2y ago
Form relation state
FilamentFFilament / ❓┊help
16mo ago
Accessing Form's without Login
FilamentFFilament / ❓┊help
6mo ago
Accessing form values after saving
FilamentFFilament / ❓┊help
3y ago