Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

add row

whenever i click on add it's creating blank row in in RI, but no in the interface 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Can you share your code here are you using for loop to display rows?

    check line number 15

    a!localVariables(
      local!items: {
        { item: "Item 1", qty: 1, unitPrice: 10 },
        { item: "Item 2", qty: 2, unitPrice: 20 }
      },
      a!gridLayout(
        label: "Products",
        instructions: "Update the item name, quantity, or unit price.",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Item"),
          a!gridLayoutHeaderCell(label: "Qty"),
          a!gridLayoutHeaderCell(label: "Unit Price"),
          a!gridLayoutHeaderCell(label: "Total", align: "RIGHT")
        },
        rows: a!forEach( /* loop to show all rows*/
          items: local!items,
          expression: a!gridRowLayout(
            contents: {
              a!textField(
                value: fv!item.item,
                saveInto: fv!item.item
              ),
              a!integerField(value: fv!item.qty, saveInto: fv!item.qty),
              a!floatingPointField(
                value: fv!item.unitPrice,
                saveInto: fv!item.unitPrice
              ),
              a!textField(
                value: tointeger(fv!item.qty) * todecimal(fv!item.unitPrice),
                readOnly: true,
                align: "RIGHT"
              )
            }
          )
        ),
        rowHeader: 1,
        addRowLink: a!dynamicLink(
          label: "Add row",
          saveInto: a!save(
            local!items,
            append(
              local!items,
              { item: null, qty: null, unitPrice: null }
            )
          )
        )
      )
    )a!localVariables(
      local!items: {
        { item: "Item 1", qty: 1, unitPrice: 10 },
        { item: "Item 2", qty: 2, unitPrice: 20 }
      },
      a!gridLayout(
        label: "Products",
        instructions: "Update the item name, quantity, or unit price.",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Item"),
          a!gridLayoutHeaderCell(label: "Qty"),
          a!gridLayoutHeaderCell(label: "Unit Price"),
          a!gridLayoutHeaderCell(label: "Total", align: "RIGHT")
        },
        rows: a!forEach( /* loop to show all rows*/
          items: local!items,
          expression: a!gridRowLayout(
            contents: {
              a!textField(
                value: fv!item.item,
                saveInto: fv!item.item
              ),
              a!integerField(value: fv!item.qty, saveInto: fv!item.qty),
              a!floatingPointField(
                value: fv!item.unitPrice,
                saveInto: fv!item.unitPrice
              ),
              a!textField(
                value: tointeger(fv!item.qty) * todecimal(fv!item.unitPrice),
                readOnly: true,
                align: "RIGHT"
              )
            }
          )
        ),
        rowHeader: 1,
        addRowLink: a!dynamicLink(
          label: "Add row",
          saveInto: a!save(
            local!items,
            append(
              local!items,
              { item: null, qty: null, unitPrice: null }
            )
          )
        )
      )
    )

  • see i have written the same code

    but still it is not creating the row instead their are 13 rows it has created 13 rows by default

  • 0
    Certified Lead Developer
    in reply to KM

    Okay check that you are using a different variable for looping and when you are adding a new row you are using a different rule input. I think they should be same.

    rule input you are using for looping.

    rule input in which you are adding a new row.

  • yes, from that getcontractid_cdt am fetching data to show the in dropdown.

    once i save that dropdown that values has to be stored in contractsaved_cdt and whenever add row that has to be added to contractsaved_cdt

    to below the added row should show the same values what it has shown at the first time(i mean same dropdown values to be shown)

Reply Children