Add new row using dynamic link in editable grid

Requirement : we need to add a new row functionality in a editable grid which has only one column structure .

Inputs : one Rule input of type text .( No cdt)

             A editable grid with only one column of type text

Error : if I click add row using dynamic link , a new row gets created , user inputs value and clicks again add new row link . Now new row gets created with same input value which user has given . This happens for n number of new row creation .

If I change the latest input value in a row , the remaining row value gets changed accordingly .

P.s: new to Appian . So help me understand.

Regards,

Vetri

  Discussion posts and replies are publicly visible

Parents
  • Hi Vetrivel,

    Please find the below code snippet. I took the rule input as Input of type text and multiple. you are getting the error because of you are appending the existing value at the end of the list try to append a blank value.

    a!gridLayout(
    label:"Demo",
    headerCells:{a!gridLayoutHeaderCell(label:"Name")},
    columnConfigs: a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
    rows:{
    a!forEach(
    items:ri!input,
    expression: {
    a!gridRowLayout(
    contents:{
    a!textField(
    label:""&fv!item,
    value:fv!item,
    saveInto:{
    fv!item
    }
    )
    }
    )
    }
    )
    },
    addRowLink: a!dynamicLink(
    label:"Add New",
    value:{
    ri!input
    },
    saveInto:{
    a!save(
    ri!input,append(ri!input,"")
    )
    }
    )

    )
Reply
  • Hi Vetrivel,

    Please find the below code snippet. I took the rule input as Input of type text and multiple. you are getting the error because of you are appending the existing value at the end of the list try to append a blank value.

    a!gridLayout(
    label:"Demo",
    headerCells:{a!gridLayoutHeaderCell(label:"Name")},
    columnConfigs: a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
    rows:{
    a!forEach(
    items:ri!input,
    expression: {
    a!gridRowLayout(
    contents:{
    a!textField(
    label:""&fv!item,
    value:fv!item,
    saveInto:{
    fv!item
    }
    )
    }
    )
    }
    )
    },
    addRowLink: a!dynamicLink(
    label:"Add New",
    value:{
    ri!input
    },
    saveInto:{
    a!save(
    ri!input,append(ri!input,"")
    )
    }
    )

    )
Children
No Data