Editiable grid save selected and newly added data field in new rule input of different record type

Hi I am trying something like this , I have editable grid for which data will be populated from local!data of type AB recordtype , I want to edit the row data and select them and save into another recordtype thorugh a rule input , I want to add new row also but when i try the rule input is getting updated but the grid row is not created and when i try to edit the pouplated data its not getting saved. I know im missing something I am a  beginner so can anyone guide me achive my requirement?

 

a!localVariables(
  local!datatype: a!queryRecordType(
 
    recordType: {
 
      'recordType!{479ce76d-f462-432e-80f8-34a12cfb2725}RPM Candidate',
 
    },
 
    fields: {
 
      'recordType!{479ce76d-f462-432e-80f8-34a12cfb2725}RPM Candidate.fields.{6f148197-c427-48b6-a52c-0f8c403c81e2}id',
 
      
    },

 
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)

 
  ),
 
a!sectionLayout(
 
    label: "",
 
    contents: {
 
      a!gridLayout(
 
        label: "Editable Grid",
 
        labelPosition: "ABOVE",
 
        headerCells: {
 
          a!gridLayoutHeaderCell(label: "CandidateId"),
 
      
 
        

 
        },
 
        columnConfigs: {
 
          a!gridLayoutColumnConfig("ICON"),
 
        
 
          
 
        
 
        },
 
        rows: {
 
          a!forEach(
 
            items: local!datatype.data,
 
            expression: a!gridRowLayout(
 
              id: fv!index,
 
              contents: {
 
                a!integerField(
                  readOnly: false(),
 
                  label: "CandidateId",
 
                  value: fv!item['recordType!{479ce76d-f462-432e-80f8-34a12cfb2725}RPM Candidate.fields.{6f148197-c427-48b6-a52c-0f8c403c81e2}id'],
                  saveInto: ri!record['recordType!{32995c06-561c-49ee-b80d-ed0f4f196a63}RPM Interview Details.fields.{145ec156-2b46-4a8d-9329-746d1108a3af}candidateId']

 
                ),
 
             
 
                
 
               
              }
 
            )
 
          )
 
        },
        selectable: true,
        selectionValue: ,
        selectionSaveInto
        addRowLink: a!dynamicLink(
          label: "Add Plan",
          value: 'recordType!{32995c06-561c-49ee-b80d-ed0f4f196a63}RPM Interview Details'(
            'recordType!{32995c06-561c-49ee-b80d-ed0f4f196a63}RPM Interview Details.fields.{145ec156-2b46-4a8d-9329-746d1108a3af}candidateId':null,
            'recordType!{32995c06-561c-49ee-b80d-ed0f4f196a63}RPM Interview Details.fields.{b7099aba-ad0d-489f-a68d-5457c3203bf7}feedback': ""

          ),
          saveInto: ri!record
        ),

 
        shadeAlternateRows: true
 
      ),
      a!buttonLayout(
 
        primaryButtons: {
 
          a!buttonWidget(
 
            label: "save",
            saveInto: a!save(
 
              ri!record['recordType!{32995c06-561c-49ee-b80d-ed0f4f196a63}RPM Interview Details']
            ),
 
            submit: true,
 
            style: "SOLID",
 
            loadingIndicator: true,
 
 
          )
 
        },
 
       
 
      )
 
    },

 
   
 
  )
 
)

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    The issue I see is, that your "Add Row Link" adds a new item to the rule input, but your grid uses the local variable. Change that link to add the item to the local.

    Same for that saveInto in line 76. You need to manipulate the data you show on screen. Not something else.

    Now, once the user did all the modifications, add a saveInto to the submit button to copy the values from that local to the rule input.