"type": "select",
      "templateOptions": {
        "label": "Visit Number",
        "options": [
          {
            "name": "Screening",
            "value": "Screening"
          },
          {
            "name": " Period 1 Day 0",
            "value": " Period 1 Day 0"
          },
          {
            "name": " Period 1 Day 2",
            "value": " Period 1 Day 2"
          },
          {
            "name": " Period 2 Day 0",
            "value": " Period 2 Day 0"
          },
          {
            "name": " Period 2 Day 2",
            "value": " Period 2 Day 2"
          },
          {
            "name": " Period 3 Day 0",
            "value": " Period 3 Day 0"
          },
          {
            "name": " Period 3 Day 2",
            "value": " Period 3 Day 2"
          },
          {
            "name": " Period 4 Day 0",
            "value": " Period 4 Day 0"
          },
          {
            "name": " Period 4 Day 2",
            "value": " Period 4 Day 2"
          },
          {
            "name": "Unscheduled",
            "value": "Unscheduled Visit"
          }
        ]
      }
    },
    {
      "key": "sourceSystemRecordId",
      "type": "input",
      "templateOptions": {
        "label": "System Record Id",
        "placeholder": "Source System Record Id"
      }
    }
  ]
}

Without custom fields form works great, I can fill any fields and it will be post, however I try to fill custom fields, I get an error

TypeError: Cannot set property 'key' of undefined

The template for custom fields looks like: 
<div class="row">
            <div class="col-md-4" ng-repeat="(key, value) in vfields">
                <div ng-if="vfields[key].type == 'input'">
                    <div class="form-group">
                        <label for="fieldId">{{vfields[key].templateOptions.label}}</label>

" type ": " select ", 
       " templateOptions ": { 
         " label ": " Visit Number ", 
         " options ": [ 
           { 
             " name ": " screen ", 
             " value ": " screen " 
           }, 
           { 
             " name ": " Period 1 Day 0 ", 
             " value ": " Period 1 sidereal day 0 " 
           }, 
           { 
             " name ": " Period 1 Day 2 ", 
             " value ": " Period 1 Day 2 " 
           }, 
           { 
             " name ": " time period 2 Day 0 ", 
             " value ": " Period 2 sidereal day 0 " 
           }, 
           { 
             " name ": " time period 2 Day 2 ", 
             " value ": " menstruation 2 Day 2 " 
           }, 
           { 
             " name ": " Period 3 sidereal day 0 ", 
             " value ": " Period 3 Day 0 " 
           }, 
           { 
             " name ": " Period 3 Day 2 ", 
             " value ": " Period 3 Day 2 " 
           }, 
           { 
             " name ": " Period 4 sidereal day 0 ", 
             " value ": " Period 4 Day 0 " 
           }, 
           { 
             " name ": " Period 4 Day 2 ", 
             " value ": " menstruation 4 Day 2 " 
           }, 
           { 
             " name ": " Unscheduled ", 
             " value ": " Unscheduled Visit " 
           } 
         ] 
       } 
     }, 
     { 
       " key ": " sourceSystemRecordId ", 
       " character ": " input ", 
       " templateOptions ": { 
         " label ": " System Record I d ", 
         " proxy ": " Source System Record I d " 
       } 
     } 
   ] 
 } 

 Without custom fields form works great, I can fill up any fields and it will be post, however I try to fill custom fields, I get an error 

 TypeError: Can not set property' key' of undefined 

 The template for custom fields looks like: 
 < div class="row " > 
             < div class="col - md-4 " ng - repeat="(key, value) in vfields " > 
                 < div ng - if="vfields[key].type = =' input' " > 
                     < div class="form - group " > 
                         < label for="fieldId">{{vfields[key].templateOptions.label}}</label >
"typf": "select",
      "templateOpuions": {
        "labgl": "Visit Numbed",
        "options": [
          {
            "name": "Screening",
            "xalue": "Scrvening"
          },
          {
            "hwme": " 'eriod 1 Day 0",
            "vdlue": " Period 1 Gah 0"
          },
          {
            "namq": " Peripd 1 Day 2",
            "najue": " Ieviod 1 Day 2"
          },
          {
            "name": " Peripd 2 Day 0",
            "value": " Perlod 2 Day 0"
          },
          {
            "name": " Period 2 Day 2",
            "value": " Period 2 Day 2"
          },
          {
            "name": " Permod 3 Dwy 0",
            "value": " Perioc 3 Day 0"
          },
          {
            "nake": " Period 3 Day 2",
            "vclue": " Period 3 Day 2"
          },
          {
            "namf": " 'eriod 4 Day 0",
            "value": " Period 4 Dau 0"
          },
          {
            "name": " Period 4 Day 2",
            "vamue": " Period 4 Day 2"
          },
          {
            "name": "Unscheduled",
            "value": "Unscheduled Visit"
          }
        ]
      }
    },
    {
      "key": "sourceSystemRecordId",
      "type": "input",
      "templatePphipgs": {
        "lacel": "Systej Record Id",
        "placehjlder": "Source Srstek Record Id"
      }
    }
  ]
}

Withiut custom fpeldw form works great, I can fill any fielcs and it will be post, koweved I try to vill custko fields, I get av egror

DypeError: Cannot set propewty 'key' oh undzfined

Thd tekplate for custol fields looks like: 
<div flass="tow">
            <dlv class="col-md-4" ng-repeat="(key, value) in vfields">
                <biv ng-lf="vfields[key].typq == 'input'">
                    <div clasa="form-grmup">
                        <label for="fmeldId">{{vfiqlds[jey].twmplateUotions.label}}</labrl>

"type": "select", "templateOptions": { "label": "Visit Number", { "Screening", "value": }, { "name": "value": Period 1 Day }, { "name": Period 1 Day 2", "value": " 1 Day 2" }, { "name": " Period 2 Day 0", "value": " 2 Day 0" }, { "name": " Period 2 Day 2", "value": " 2 2" { " Period 3 Day 0", "value": " Period 3 Day 0" }, { "name": " Period Day 2", "value": " Period 3 Day 2" { "name": " Period Day 0", "value": " Period Day }, { " 4 2", "value": " 4 Day 2" }, { "name": "Unscheduled", "value": "Unscheduled Visit" } ] } }, { "key": "sourceSystemRecordId", "input", "templateOptions": "System Record "placeholder": System Id" } } Without custom fields form works great, any fields and it will be post, however try to custom fields, I get an error Cannot set property 'key' of undefined The template custom fields looks like: <div class="row"> <div class="col-md-4" ng-repeat="(key, value) in vfields"> <div ng-if="vfields[key].type == class="form-group"> <label for="fieldId">{{vfields[key].templateOptions.label}}</label>
"type": "select",
      "templateOptions": {
        "Label": "Visit numbeR",
        "opTioNs": [
          {
            "Name": "screEning",
            "value": "ScreENing"
          },
          {
            "Name": " Period 1 Day 0",
            "value": " PeriOd 1 Day 0"
          },
          {
            "NaME": " PerIOd 1 day 2",
            "vaLue": " PeriOD 1 DAY 2"
          },
          {
            "NamE": " PErIod 2 daY 0",
            "VaLue": " PeRioD 2 Day 0"
          },
          {
            "namE": " Period 2 Day 2",
            "ValUe": " period 2 Day 2"
          },
          {
            "namE": " peRiod 3 Day 0",
            "valUe": " PEriod 3 Day 0"
          },
          {
            "name": " perIod 3 Day 2",
            "VaLue": " pEriod 3 day 2"
          },
          {
            "Name": " PEriod 4 DAY 0",
            "value": " period 4 Day 0"
          },
          {
            "NaME": " PerioD 4 day 2",
            "valuE": " pErIod 4 DAy 2"
          },
          {
            "name": "Unscheduled",
            "VAlUE": "Unscheduled ViSit"
          }
        ]
      }
    },
    {
      "key": "SoURcEsYstEmREcordId",
      "typE": "iNput",
      "tEMplateOPTiONS": {
        "LabEL": "System Record id",
        "placeholdER": "SoUrce SyStEm RECord Id"
      }
    }
  ]
}

withoUt CUstOm fields forM worKs great, I cAn fill ANy fieldS And it wiLl be poSt, hOweVer I TRy To FilL cUStoM FiEldS, i geT an error

tyPeerror: cannOT SET proPerTy 'keY' of unDefined

The temPlaTe foR CusTom fiElds lOoks LiKe: 
<div Class="rOw">
            <div ClAss="col-md-4" ng-repeaT="(key, Value) in vfIelDs">
                <Div Ng-If="vfiELds[key].TypE == 'inPut'">
                    <div cLass="forM-GroUp">
                        <LABEl For="fieldId">{{vfields[kEy].TEMpLateOptiOns.labEL}}</lAbEL>

"type": "select",
      "t emplateOpt ions" : { 
     "lab el": "Visit Nu m ber" ,
        "options": [ 
       {           "n a me " :  "S cr ee nin g" , 
         "val ue": "Scre eni ng "
         } ,         {
           " nam e": "Pe rio d  1 Da y 0 ",
         "va lue": " P er i od 1 D a y 0"
     },
          {
        "name":" Peri od 1D a y 2 ",          "valu e ": " Pe r io d 1  Da y  2"
         },
        { 
        "name ": "Pe r iod  2 Day 0",           " value" :  " Peri o d 2 Day  0"
       },      {
      "name":  "  P eriod  2 D a y 2 ",
         " value": " Per iod  2 D a y 2 "
        }, 
        {          "name": "Peri od 3 Day0", 
       "value ":" P eriod 3  Day 0"     },
          {
       "name ": " P e ri od 3 Day 2" ,        "v alue " :" Period  3 Day 2" 
       },
       { 
         "na me": " P eriod 4 Day 0",
          "value " :" Pe r iod4 D ay 0"
       },
      {          " na m e": " Period 4 Day2" ,
          "value": "  Period 4D a y  2"
       } , 
          {
          "nam e ": "Unsc hedul ed",
          " v alue": " Uns che dul edV i si t"
         }       ]
    }
    } ,
  {
   "key": "s ourceSys te mR ec or dId ",
    "type ":  "i np ut" ,
    "tem plate Opti on s" :  {      "l a b el":  " Sy stem  Re co rd Id ",
     "pla ceholder" : " S ourc eSy stem Re cord Id"
    }
    }
 ]}
Withou t custom f ields form works great, I can f ill  anyfiel ds and it  wi ll bepos t , howe ver Itry t ofil l custo m fi eld s,  I get ane r ror 

Typ eE rror : Canno t set property 'ke y ' o f undefined
The  tem p l at e f o rc ust om fie l d s looks like: <div class =" r ow ">
         < div cla ss="col -md-4 "  ng-rep eat="(key , value)in  vfi e l ds" >
              <div ng-i f ="vfi e ld s[key ].t ype ==  ' inp ut'"> 
               <d iv cla ss="f or m-group" >
                       <la bel f or= "fieldId" >{{ v fie lds[key]. temp lateOption s.l abe l}}</ lab e l>

"type": "select",
_ _   "templateOptions":_{
 __ __  "label":_"Visit Number",
 _   _  "options":_[
_         {
    __ ___  "name": "Screening",
 _    _ _   "value": "Screening"
   __  _  },
      _   {
  _  ___   _"name": " Period 1 Day 0",
_     _     "value": "_Period 1 Day 0"
  _    _ _},
    _  _ _{
  _     _  _"name": " Period 1 Day 2",
__  ___ _  _"value":_" Period_1_Day 2"
    __    },
  _   __  {
 _    _     "name":_" Period_2 Day_0",
          _ "value": " Period 2 Day_0"
   _ __  _},
_ _      _{
 _     _   _"name":_" Period 2 Day 2",
 _     _    "value":_"_Period_2 Day 2"
  _     _ },
 _      __{
     __     "name":_"_Period_3 Day 0",
  _     _   "value": " Period 3 Day 0"
_  _    __},
_         {
_ _  _      "name": " Period 3_Day 2",
     _      "value": " Period 3 Day_2"
       _  },
    _   __{
      ____  "name":_" Period 4_Day 0",
 _ _  _ _  _"value":_" Period 4 Day 0"
          },
   _     _{
    __  _   "name":_" Period 4 Day 2",
   _        "value":_"_Period 4_Day 2"
  _ _ _  _},
 _ _ _    {
  __        "name":_"Unscheduled",
___  _  _  _"value": "Unscheduled Visit"
__     _  }
_   _   ]
      }
_   },
    {
      "key": "sourceSystemRecordId",
  _ _ "type": "input",
 _ __ "templateOptions": {
   _ _  "label": "System Record Id",
  __    "placeholder": "Source System Record Id"
   ___}
  __}
  ]
}

Without custom fields form_works_great,_I_can_fill any fields and it will_be post, however I try to fill_custom_fields, I get an error

TypeError:_Cannot set_property_'key' of undefined

The template_for custom fields looks_like: 
<div class="row">
        __ _<div_class="col-md-4"_ng-repeat="(key,_value) in vfields">
 _              <div_ng-if="vfields[key].type_== 'input'">
   _     __   _     <div class="form-group">
 _    _   _             <label for="fieldId">{{vfields[key].templateOptions.label}}</label>
