Invalid index: Cannot index property 'subFunction' into type List of Null

Hi All -

I am trying to push data to my CDT, but every time I am getting the below error. I am very new to Appian, pls suggest.

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error [evaluation ID = W49K4TOI] : An error occurred while executing a save: java.lang.IllegalArgumentException: Invalid index: Cannot index property 'subFunction' into type List of Null

Pls find the below code for "Save" button. Values for local variables (Sub Func, Sub Team and approvers) are coming from their designated fields.

a!buttonWidget(
        label: "Save",
        saveInto: {
          if(local!newRow="Y",
          {
            a!save(local!newDetails.subFunction, local!newSubFunc),
            a!save(local!newDetails.subTeam, local!newSubTeam),
            a!save(local!newDetails.approver1, local!approver1),
            a!save(local!newDetails.approver2, local!approver2),
            a!save(local!newDetails.approver3, local!approver3),
            a!save(local!newDetails.approver4, local!approver4),
            
            a!save(local!newSubFunc,""),
            a!save(local!newSubTeam,""),
            a!save(local!approver1,""),
            a!save(local!approver2,""),
            a!save(local!approver3,""),
            a!save(local!approver4,""),
            
            a!writeToDataStoreEntity(cons!GFO_HCR_PTR_DSE_FUNCTION,local!newDetails),
            a!save(local!funcationDetails,rule!GFO_HCR_GetAllFunctionTeam()),
            
            a!save(local!newRow,"N")
          },
            null()
          )
          
        },
        submit: false
      )

Kindly help me to fix this issue. Thanks in advance.

Regards/Mp

  Discussion posts and replies are publicly visible