Creating a new datatable from one row of another datable

I used Copilot to help convert this into activities

  • Activity: For Each Row (TypeArgument: DataRow)
    • Values: dt_1.Rows
    • Body:
      • Activity: For Each (TypeArgument: Int32)
        • Values: Enumerable.Range(8, dt_1.Columns.Count - 8).Where(Function(i) i Mod 8 = 0)
        • Body:
          • Activity: Assign
            • To: newRow
            • Value: dt_2.NewRow()
          • Activity: For Each (TypeArgument: Int32)
            • Values: Enumerable.Range(0, 8)
            • Body:
              • Activity: If
                • Condition: CurrentItem + i < dt_1.Columns.Count
                • Then:
                  • Activity: Assign
                    • To: newRow(CurrentItem)
                    • Value: row(CurrentItem + i)
          • Activity: Add Data Row
            • Properties:
              • DataTable: dt_2
              • ArrayRow: newRow.ItemArray

I am getting an ‘Invalid Item Name’ validation on the For Each Row in Datatable block, but none of the child activities are showing any issues. Anny suggestions?