Skip to main content
sanjuktab2257
July 31, 2025
Solved

Preserve the selected grid value when a row is double-clicked.

  • July 31, 2025
  • 4 replies
  • 0 views

I'm trying to simulate a double-click-like behavior in a read-only grid using a!gridField_24r3. The goal is to return a selected row's value when a user clicks on a field grid value twice.

I am able to save the value of the grid after selecting it for the very first time by using fv!deselectedRows. Refer below code:

a!save(
                local!previousSelectedRow,
                if(
                  length(local!currentSelectedRow) = 0,
                  index(fv!deselectedRows, 1, null),
                  local!previousSelectedRow
                )
              )

Now within the parameter "selectionvalue" of a!gridField_24r3, I am trying to manipulate the value it holds with below logic where I put a condition if there is no selection made --> ri!selected will be empty but we have a value store within local!previousSelectedrow then we should get the id of that grid returned.

if(
  a!isNotNullOrEmpty(ri!selected),
  ri!selected, 
  if(
    a!isNotNullOrEmpty(tointeger(property(local!previousSelectedRow, "id", null))),
    property(local!previousSelectedRow, "id", null),
    null
  )
)

But selectionvalue is not getting updated. Its only holding the values on selection. Could anyone guide me here.

Best answer by shubhama926776

SelectionValue is read-only - it only displays the current selection state. You can't use it to force selections. When a user deselects, Appian clears the selection internally and your conditional logic in selectionValue won't override this.

Use selectionSaveInto to detect the double-click pattern:

selectionSaveInto: {
  a!save(ri!selected, save!value),
  if(
    and(
      length(save!value) = 0,  /* Deselected */
      length(fv!deselectedRows) = 1,  /* Single row deselected */
      fv!deselectedRows[1] = local!lastSelectedRow  /* Same row */
    ),
    /* Trigger double-click action */
    a!save(local!doubleClickedRow, fv!deselectedRows[1]),
    a!save(local!lastSelectedRow, fv!selectedRows[1])
  )
}

4 replies

shubhama926776
July 31, 2025

SelectionValue is read-only - it only displays the current selection state. You can't use it to force selections. When a user deselects, Appian clears the selection internally and your conditional logic in selectionValue won't override this.

Use selectionSaveInto to detect the double-click pattern:

selectionSaveInto: {
  a!save(ri!selected, save!value),
  if(
    and(
      length(save!value) = 0,  /* Deselected */
      length(fv!deselectedRows) = 1,  /* Single row deselected */
      fv!deselectedRows[1] = local!lastSelectedRow  /* Same row */
    ),
    /* Trigger double-click action */
    a!save(local!doubleClickedRow, fv!deselectedRows[1]),
    a!save(local!lastSelectedRow, fv!selectedRows[1])
  )
}

sanjuktab2257
August 1, 2025

Although if I am putting the logic in selectionSaveInto, I am not able to ignore the parameter selectionValue and its by default passing the selected row on single click and in double click, its passing null.

stefanhelzle0001
July 31, 2025

There is no double-click in Appian. You could do a "very slow two clicks" thingy, but I am pretty sure this does not meet your users expectations.

harshas2775
July 31, 2025

As per good design practice number of clicks should be reduced for good UX. I would suggest to have single click selection instead of double (read 2 single) clicks as they are more user friendly.