title: Magento 2 Ui Component: how to set serializable field for dynamic rows
body: <p>In Magento 2.3.4 I've created a Dynamic Row in a component UI form.</p>
  
  <p>Now when I save I've faced this problem, data are not correctly serialized.
  I dug in the code and I found this function
  </p>
  
  <pre><code> protected function _serializeFields(\Magento\Framework\Model\AbstractModel $object)
      {
          foreach ($this-&gt;_serializableFields as $field =&gt; $parameters) {
              list($serializeDefault, $unserializeDefault) = $parameters;
              $this-&gt;_serializeField($object, $field, $serializeDefault, isset($parameters[2]));
          }
      }
  </code></pre>
  
  <p>but I don't understand </p>
  
  <ul>
  <li><strong>how to set a specific component as serializable</strong>? </li>
  <li><strong>How to get my dynamic row to be in $this->_serializableFields ?</strong></li>
  </ul>
  
  <p>An example of my component.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;container name="categories_mapping"&gt;
              &lt;argument name="data" xsi:type="array"&gt;
                  &lt;item name="config" xsi:type="array"&gt;
                      &lt;item name="component" xsi:type="string"&gt;Magento_Ui/js/dynamic-rows/dynamic-rows&lt;/item&gt;
                      &lt;item name="template" xsi:type="string"&gt;ui/dynamic-rows/templates/default&lt;/item&gt;
                      &lt;item name="componentType" xsi:type="string"&gt;dynamicRows&lt;/item&gt;
                      &lt;item name="recordTemplate" xsi:type="string"&gt;record&lt;/item&gt;
                      &lt;item name="addButtonLabel" xsi:type="string"&gt;Add New Category Rule&lt;/item&gt;
                      &lt;item name="deleteProperty" xsi:type="boolean"&gt;false&lt;/item&gt;
                      &lt;item name="additionalClasses" xsi:type="string"&gt;admin__field-wide&lt;/item&gt;
                      &lt;item name="options"
                            xsi:type="object"&gt;Triboo\RelatedCreator\Ui\Component\Listing\Column\RulesActions
                      &lt;/item&gt;
                  &lt;/item&gt;
              &lt;/argument&gt;
              &lt;container name="record"&gt;
                  &lt;argument name="data" xsi:type="array"&gt;
                      &lt;item name="config" xsi:type="array"&gt;
                          &lt;item name="label" xsi:type="string" translate="true"&gt;Dynamic Rows&lt;/item&gt;
                          &lt;item name="component" xsi:type="string" translate="true"&gt;Magento_Ui/js/dynamic-rows/record
                          &lt;/item&gt;
                          &lt;item name="componentType" xsi:type="string"&gt;container&lt;/item&gt;
                          &lt;item name="isTemplate" xsi:type="boolean"&gt;true&lt;/item&gt;
                          &lt;item name="is_collection" xsi:type="boolean"&gt;true&lt;/item&gt;
                          &lt;item name="showFallbackReset" xsi:type="boolean"&gt;false&lt;/item&gt;
                      &lt;/item&gt;
                  &lt;/argument&gt;
                  &lt;field name="category" formElement="select"&gt;
                      &lt;argument name="data" xsi:type="array"&gt;
                          &lt;item name="config" xsi:type="array"&gt;
                              &lt;item name="dataType" xsi:type="string"&gt;text&lt;/item&gt;
                              &lt;item name="label" xsi:type="string" translate="true"&gt;Category Source&lt;/item&gt;
                              &lt;item name="dataScope" xsi:type="string"&gt;category&lt;/item&gt;
                              &lt;item name="showFallbackReset" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;item name="validation" xsi:type="array"&gt;
                                  &lt;item name="required-entry" xsi:type="boolean"&gt;true&lt;/item&gt;
                              &lt;/item&gt;
                              &lt;item name="sortOrder" xsi:type="string"&gt;10&lt;/item&gt;
                          &lt;/item&gt;
                      &lt;/argument&gt;
                      &lt;formElements&gt;
                          &lt;select&gt;
                              &lt;settings&gt;
                                  &lt;options class="Triboo\RelatedCreator\Model\Config\Source\Category"&gt;&lt;/options&gt;
                              &lt;/settings&gt;
                          &lt;/select&gt;
                      &lt;/formElements&gt;
                  &lt;/field&gt;
                  &lt;field name="include_subcat" formElement="checkbox"&gt;
                      &lt;argument name="data" xsi:type="array"&gt;
                          &lt;item name="config" xsi:type="array"&gt;
                              &lt;item name="dataType" xsi:type="string"&gt;text&lt;/item&gt;
                              &lt;item name="label" xsi:type="string" translate="true"&gt;Include subcat for source&lt;/item&gt;
                              &lt;item name="dataScope" xsi:type="string"&gt;include_subcat&lt;/item&gt;
                              &lt;item name="source" xsi:type="string"&gt;include_subcat&lt;/item&gt;
                              &lt;item name="disabled" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;item name="validation" xsi:type="array"&gt;
                                  &lt;item name="required-entry" xsi:type="boolean"&gt;true&lt;/item&gt;
                              &lt;/item&gt;
                              &lt;item name="sortOrder" xsi:type="string"&gt;30&lt;/item&gt;
                          &lt;/item&gt;
                      &lt;/argument&gt;
                      &lt;formElements&gt;
                          &lt;checkbox&gt;
                              &lt;settings&gt;
                                  &lt;valueMap&gt;
                                      &lt;map name="false" xsi:type="number"&gt;0&lt;/map&gt;
                                      &lt;map name="true" xsi:type="number"&gt;1&lt;/map&gt;
                                  &lt;/valueMap&gt;
                                  &lt;prefer&gt;toggle&lt;/prefer&gt;
                              &lt;/settings&gt;
                          &lt;/checkbox&gt;
                      &lt;/formElements&gt;
                  &lt;/field&gt;
  
                  &lt;field name="mapping" formElement="multiselect"&gt;
                      &lt;argument name="data" xsi:type="array"&gt;
                          &lt;item name="config" xsi:type="array"&gt;
                              &lt;item name="dataType" xsi:type="string"&gt;text&lt;/item&gt;
                              &lt;item name="label" xsi:type="string" translate="true"&gt;Related products from&lt;/item&gt;
                              &lt;item name="dataScope" xsi:type="string"&gt;mapping&lt;/item&gt;
                              &lt;item name="disabled" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;item name="validation" xsi:type="array"&gt;
                                  &lt;item name="required-entry" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;/item&gt;
                              &lt;item name="sortOrder" xsi:type="string"&gt;40&lt;/item&gt;
                          &lt;/item&gt;
                      &lt;/argument&gt;
                      &lt;formElements&gt;
                          &lt;multiselect&gt;
                              &lt;settings&gt;
                                  &lt;options class="Triboo\RelatedCreator\Model\Config\Source\Category"&gt;&lt;/options&gt;
                              &lt;/settings&gt;
                          &lt;/multiselect&gt;
                      &lt;/formElements&gt;
                  &lt;/field&gt;
                  &lt;field name="follow_rules" formElement="checkbox"&gt;
                      &lt;argument name="data" xsi:type="array"&gt;
                          &lt;item name="config" xsi:type="array"&gt;
                              &lt;item name="dataType" xsi:type="string"&gt;text&lt;/item&gt;
                              &lt;item name="label" xsi:type="string" translate="true"&gt;Apply attribute rules out&lt;/item&gt;
                              &lt;item name="dataScope" xsi:type="string"&gt;follow_rules&lt;/item&gt;
                              &lt;item name="source" xsi:type="string"&gt;follow_rules&lt;/item&gt;
                              &lt;item name="disabled" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;item name="validation" xsi:type="array"&gt;
                                  &lt;item name="required-entry" xsi:type="boolean"&gt;false&lt;/item&gt;
                              &lt;/item&gt;
                              &lt;item name="sortOrder" xsi:type="string"&gt;50&lt;/item&gt;
                          &lt;/item&gt;
                      &lt;/argument&gt;
                      &lt;formElements&gt;
                          &lt;checkbox&gt;
                              &lt;settings&gt;
                                  &lt;valueMap&gt;
                                      &lt;map name="false" xsi:type="number"&gt;0&lt;/map&gt;
                                      &lt;map name="true" xsi:type="number"&gt;1&lt;/map&gt;
                                  &lt;/valueMap&gt;
                                  &lt;prefer&gt;toggle&lt;/prefer&gt;
                              &lt;/settings&gt;
                          &lt;/checkbox&gt;
                      &lt;/formElements&gt;
                  &lt;/field&gt;
  </code></pre>