Skip to main content
July 21, 2024
Solved

Get task id in grid with selection

  • July 21, 2024
  • 15 replies
  • 0 views

Hello I'm trying to get the task id from my read only grid with selection function of grids. I'm trying to store the task id in rule input, but what this is doing now is when I select one row it's storing all task id's in the rule input not only the single which I have selected and it's not updating the selection in the UI it's refreshing and the selection is gone. And when I load the interface by default it's showing 1 selected.

I want to be able to select one row pick the task id store it in rule input and show in the UI that the row is selected, then the same if I select another one save the task id and update UI if something is unselected remove that value from the rule input and update the UI.

pageSize: 20,
    selectable: true,
    selectionValue: local!report.data[1]["c19"],
    selectionSaveInto: a!save(
      saveInto: ri!test,
      value: local!report.data["c19"]
    ),
    showSelectionCount: "ON",
    rowHeader: 1

Best answer by venkatrea696188

just use fv!selectedrows.c19, aren't you indexed this way to show it on grid itself?? fv!row.c19

15 replies

stefanhelzle0001
Brainy
July 21, 2024

When you follow this example

https://docs.appian.com/suite/help/24.2/recipe-limit-the-number-of-rows-in-a-grid-that-can-be-selected.html

you will see that "fv!selectedRows" will contain only the selected items.

July 21, 2024

How I can implement that in my code?

karumurua531442
July 21, 2024

Hi [mention:65064d657301491bb67136887baaec4d:e9ed411860ed4f2ba0265705b8793d05] you need to follow the below code for having selection in reading only grid. You can make the changes for the below code as per your requirement 

selectionSaveInto: {

                local!selection,

               

                a!save(

                  local!selectedEmployees,

                  append(

                    local!selectedEmployees,

                    fv!selectedRows

                  )

                ),

                /*This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedEmployees. */

                a!save(

                  local!selectedEmployees,

                  difference(

                    local!selectedEmployees,

                    fv!deselectedRows

                  )

                )

              }

July 21, 2024

My grid is coming from process report, I need to see if i can adjust as per mention

venkatrea696188
July 21, 2024

Whatever the source might be fv!selectedRows and fv!deselectedRows holds the data of selected/deselected rows.  In your save remove the index you are doing and use  the template that pasted by Abhishek (replace local!selectedEmployees with ri!test).