Using TableField with Node:Create? I've been struggling with this for a few days. I currently have a form which I am creating and rendering through Drupal 8's Form API. I am saving the inputted field values using Node::create() which has been working great. I am now using the Tablefield module for some of the fields. I am struggling to save this data as part of the Node::create() function however. I am reasonably new to Form API so I'm sure I'm missing something obvious.

My current Node::create() is a little like this

$node = Node::create([
      'type'                      =&gt; 'business',
      'status'                    =&gt; 1,
      'field_membership_type'     =&gt; $form_state-&gt;getValue('type_of_membership'),
      'field_type_of_business'    =&gt; $form_state-&gt;getValue('membersInTheQuarter_type'),
      'field_business_size'       =&gt; $form_state-&gt;getValue('businessSize_antique'),
      'field_business_size_shop_' =&gt; $form_state-&gt;getValue('businessSize_independentShops'),
      'field_category'            =&gt; $form_state-&gt;getValue('businessCategory'),
      'field_additional_category' =&gt; $form_state-&gt;getValue('additionalBusinessCategory'),
      'field_category_custom_'    =&gt; $form_state-&gt;getValue('businessCategoryCustom'),
      'title'                     =&gt; $form_state-&gt;getValue('business_name'),
      'field_tag_line'            =&gt; $form_state-&gt;getValue('tag_line'),
      'field_about'               =&gt; $form_state-&gt;getValue('about'),
      'field_opening_hours'       =&gt; /**This is where I need to access the individual cells of tablefield to set values from my form**/
    ]);

  $node-&gt;save();
This has not much to do with form API, only with the structure of the field.

You need to pass in the values that the field type expects, based on its propertyDefinitions() method for example. Looking at http://cgit.drupalcode.org/tablefield/tree/src/Plugin/Field/FieldType/TablefieldItem.php?h=8.x-2.x#n141, it does some special processing on it, so might have to account for that.

The easiest option for that kind of stuff is usually to just create a node in the UI, then load it and call $node->toArray(). The structure that you get back ther for your field is usually also what it expects to be set.