Get task id in grid with selection

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

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi  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

                      )

                    )

                  }

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

  • 0
    Certified Senior Developer
    in reply to Shwapx

    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).

  • Okay but that save the whole row of data from the process report. how to save for each row task id which is located here - local!report.data["c19"]


    pageSize: 20,
        selectable: true,
        selectionValue: local!selection,
        selectionSaveInto: {
          local!selection,
          /*This save adds the full rows of data for items selected in the most recent user interaction to local!selectedEmployees. */
          a!save(
            ri!test,
            append(
              ri!test,
              fv!selectedRows
            )
          ),
          /*This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedEmployees. */
          a!save(
            ri!test,
            difference(
              ri!test,
              fv!deselectedRows
            )
          )
        },

Reply
  • Okay but that save the whole row of data from the process report. how to save for each row task id which is located here - local!report.data["c19"]


    pageSize: 20,
        selectable: true,
        selectionValue: local!selection,
        selectionSaveInto: {
          local!selection,
          /*This save adds the full rows of data for items selected in the most recent user interaction to local!selectedEmployees. */
          a!save(
            ri!test,
            append(
              ri!test,
              fv!selectedRows
            )
          ),
          /*This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedEmployees. */
          a!save(
            ri!test,
            difference(
              ri!test,
              fv!deselectedRows
            )
          )
        },

Children