© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
iprastha

access filter data from table action or bulk action

In a table i'm creating a bulk action with modal forms, I need to get a value from the table filter (such as from a value from a select filter) to create the modal form. How do I access these table filter values from bulk action form?
Solution
Thank you, finally got it working with the following bulk action with custom form , getting the filter value and putting it inside a hidden field, then the other field which requires it using $get method:
BulkAction::make('MyAction')
->mountUsing( function(Forms\ComponentContainer $form, Table $table){
  $form->fill([
    'myHiddenField' => $table->getFilter('MyFilterName')->getState()['value'],
   ]);
})
->form([
  Forms\Components\Hidden::make('myHiddenField'),
  Forms\Components\Select::make('anotherField')
   ->options(function (Get $get) {
           // we can use $get('myHiddenField') here
    })
])
...
BulkAction::make('MyAction')
->mountUsing( function(Forms\ComponentContainer $form, Table $table){
  $form->fill([
    'myHiddenField' => $table->getFilter('MyFilterName')->getState()['value'],
   ]);
})
->form([
  Forms\Components\Hidden::make('myHiddenField'),
  Forms\Components\Select::make('anotherField')
   ->options(function (Get $get) {
           // we can use $get('myHiddenField') here
    })
])
...
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Table Bulk Action
FilamentFFilament / ❓┊help
3y ago
I need to get table query in header action or bulk action based on table filter
FilamentFFilament / ❓┊help
3y ago
Hide Bulk Upload Action on Table filter value change
FilamentFFilament / ❓┊help
2y ago
Bulk Table data (millions)
FilamentFFilament / ❓┊help
3y ago