Custom customer attributes not saving on DB in Magento 2, you need to debug in database.
have added a custom customer attribute named is customer_mobile.
It is displayed as expected in the admin forms, to create a new customer or to edit an existing customer.
When you create a custom customer attribute, it enters into the below tables.
1. eav_attribute
2. customer_eav_attribute
3. customer_eav_attribute_website
4. customer_form_attribute
“Note:- 172 is attribute id.”
Below are the steps-
eav_attribute
attribute_id => 248, entity_type_id => 1, attribute_code => on_account, attribute_model => null, backend_model => null, backend_type => int, backend_table => null, frontend_model => null, frontend_input => boolean, frontend_label => On Account, frontend_class => null, source_model => Magento\Eav\Model\Entity\Attribute\Source\Boolean, is_required => 1, is_user_defined => 1, default_value => 0, is_unique => 0, note => null
customer_eav_attribute
attribute_id => 172, is_visible => 1, input_filter => null, multiline_count => 0, validate_rules => null, is_system => 0, sort_order => 120, data_model => null, is_used_in_grid => 0, is_visible_in_grid => 0, is_filterable_in_grid => 0, is_searchable_in_grid => 0, is_used_for_customer_segment => 0 customer_eav_attribute_website attribute_id => 172, website_id => 10, is_visible => null, is_required => null, default_value => null, multiline_count => null customer_form_attribute form_code => admin html_checkout, attribute_id => 172 form_code => admin html_customer, attribute_id => 172 "Note: 172 is attribute id." When custom attribute not saving on DB in Magento2 search attribute id in database tables its depend on attribute type.
Related Blogs – Magento 2.4.2 features