I am working in editable grid (Appian 7.9) and observed that if I try to select

I am working in editable grid (Appian 7.9) and observed that if I try to select a single item of the Grid the local!selected will continue to grow without holding the earlier selected values on the form. The same thing is happening when I select grid header check box .

OriginalPostID-151610

OriginalPostID-151610

  Discussion posts and replies are publicly visible

  • @vahluwalia The prime cause of this issue could be mismatch between the data types of the attributes provided to grid layout component for selection purpose versus data type of the identifiers provided to grid row layout component.

    As long as we ensure that a uniform pattern (same data type) is followed by the variable or value configured for 'selectionValue' and 'selectionSaveInto' attributes of a!gridLayout() AND variable or value configured for 'id' attribute of a!gridRowLayout(), these kind of issues won't be seen. If we take the example attached in this post, we need to ensure the following:

    Let's say ri!selectedIndices is of data type 'Text Multiple'. Then 'id' attribute of a!gridRowLayout() should be Text.

    Let's say ri!selectedIndices is of data type 'Number(Integer) Multiple'. Then 'id' attribute of a!gridRowLayout() should be Number(Integer).

    (Note: Even though if the data type isn't as desired, we need to do a explicit type casting some times. For instance, while working through this example, I have chosen label value pairs instead of cdt. The data type I have obtained is 'List of Variant'. I have done explicit type casting which gave me a value of data type 'Text Multiple')

    The above rules can be ignored in certain scenarios due to implicit type casting done by Appian at times, but still it would be worth to ensure from the programmers side that we are configuring the component with a perfect idea over it.

    Provided if the code snippets are attached (along with the definitions of ri!, ac! passed to the rules), I could rectify them.
  • I have the same problem. As a workaround, I didn't use the selection option in the editable grid, but I've added a check box in the inline grid row and set the value of it to the row id. The definition of the grid row may looks like this
    a!gridRowLayout(
    id:ri!index,
    contents: {
    a!checkboxField(
    label:"Select" & ri!index,
    choiceLabels :{""},
    choiceValues :{if(rule!APN_isBlank(ri!index),{0},ri!index)},
    saveInto :{
                                  ri!selectedIndex
    }
    ),
    a!textField(
    label: "Second Column " & ri!index,
    value:ri!items[ri!index].secondColumnValue,
    readOnly: true
    ),
    a!textField(
    label: "Third Columns " & ri!index,
    value: ri!items[ri!index].ThirdColumnVale,
    readOnly: true,
    align: "RIGHT"
    )
    }
  • forget to add the checkboxField value. the checkboxfield should be like this
    a!checkboxField(
    label:"Select" & ri!index,
    choiceLabels :{""},
    choiceValues :{if(rule!APN_isBlank(ri!index),{},ri!index)},
                                  value:if(ri!selectedIndex=tointeger(ri!index),ri!selectedIndex, {}),
    saveInto :{
                                  ri!selectedIndex
    }
    )