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