Magento2: Store Configuration Table with multiple fields

The question:

How can I get in the Store -> Configuration a multi-field tables whose values are serialized?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

The solution can be found in a module in this Github link.

Below you can see how this requirement is created:

You must create the following VendorName/SysConfigTable folders in /app/code/.

You must create the registration.php file in /app/code/VendorName/SysConfigTable


You must create the module.xml file in /app/code/VendorName/SysConfigTable/etc

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="VendorName_SysConfigTable" setup_version="0.0.1" />

You must create the composer.json file in /app/code/VendorName/SysConfigTable

    "name": "vendorname/sysconfigtable",
    "description": "",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/magento-composer-installer": "*"
    "suggest": {

    "type": "magento2-module",
    "version": "0.0.1",
    "license": [

    "autoload": {
        "files": [
        "psr-4": {
            "VendorName\SysConfigTable\": ""
    "extra": {
        "map": [

You must create the system.xml file in /app/code/VendorName/SysConfigTable/etc/adminhtml

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
        <tab id="vendorname_general" translate="label" sortOrder="0">
        <section id="vendorname_general_section" translate="label" type="text" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Your Multiple fields</label>
            <group id="general" translate="label"  sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
                <field id="active" translate="label" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Your Fields</label>

You must create the Fields.php file in /app/code/VendorNameSysConfigTableBlockSystemConfigFormField

namespace VendorNameSysConfigTableBlockSystemConfigFormField;

use MagentoConfigBlockSystemConfigFormFieldFieldArrayAbstractFieldArray;

 * Class Active
 * @package VendorNameSysConfigTableBlockSystemConfigFormField
class Fields extends AbstractFieldArray {

     * @var bool
    protected $_addAfter = TRUE;

     * @var
    protected $_addButtonLabel;

     * Construct
    protected function _construct() {
        $this->_addButtonLabel = __('Add');

     * Prepare to render the columns
    protected function _prepareToRender() {
        $this->addColumn('field_1', ['label' => __('Field 1')]);
        $this->addColumn('field_2', ['label' => __('Field 2')]);
        $this->addColumn('field_3', ['label' => __('Field 3')]);
        $this->addColumn('field_4', ['label' => __('Field 4')]);
        $this->_addAfter       = FALSE;
        $this->_addButtonLabel = __('Add');

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment