Skip to main content
April 24, 2022
Question

CDT values

  • April 24, 2022
  • 2 replies
  • 0 views

Hi,

In the EDIT mode of the screen data, initially when I load the data my rule input is loading the data into all of fields of the CDT.

When I click on "Add Document", I am trying to use append function. When I select any filed value in the screen, it is resetting the old value of the previously loaded data.

In this case, when you look into ODOCID is getting reset for the previous records.

Is this because of append function.

Please suggest if I have to use to any other function.

Thanks.

    2 replies

    Inspiring
    April 24, 2022

    Hi,

    There are couple of issues with your code. 

    • You didn't specify which value you need to save
    • You are appending rule input CDT to local variable (local!documents), which is not right if you are populating grid data using rule input CDT

    Your add row link logic should be like this

    addRowlink: a!dynamicLink(
              label: "Add Document",
              value: {
                type!yourCDT/*The CDT type which you have in rule input
                */
              },
              saveInto: {
                a!save(ri!opinionDocuments, append(ri!opinionDocuments, save!value))
              }
            )

    Refer to Appian documentation here https://docs.appian.com/suite/help/22.1/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html to know how to configure editable grid.

    richardm900458
    April 25, 2022

    my recommendation as best practice -
    if you try to append a new value:

    a!save(
      target: local!array,
      value: append(local!array, 'type!{urn:com:appian:types:example}ex_DataType'())
    )