Skip to main content
saahilm0001
Known Participant
Jul 10, 2021 2:05 PM UTC
Question

Selectables in read-only grid

Hi All,

I am using selectables in read-only grid, based on the selected row I need to show a value in a particular column. In editable grid, we can configure the readonly as not(contains(ri!selectionList,fv!index)). But how to check whether the current row is in the selected list. How to get the row id in read-only grid?

10 replies

stefanhelzle0001
Brainy
Jul 10, 2021 3:18 PM UTC

Documentation says that the grid stores the ID.

https://docs.appian.com/suite/help/21.2/read-only-grid-configuration.html#selection

Something like this should do it. Copied you snippet.

not(contains(ri!selectionList,fv!row.id))

saahilm0001
Known Participant
Jul 10, 2021 4:12 PM UTC

Hi Stefan, actually in a paging grid, for data as a data subset, the data subset identifier gets stored as the selection value. 

I have a date column, which is initially not visible. But as soon as a row is selected the entire date column becomes visible and not only the specific row date. Any idea?

stefanhelzle0001
Brainy
Jul 10, 2021 6:18 PM UTC

Would need to see at least some code snippets. What is the field name of your primary key? That must be used in contains().

dastagirid756
Participating Frequently
Jul 12, 2021 4:11 AM UTC

I hope following code fragments helps you in saving code fragments.

/*Local variable declaration*/
...
local!selectedMappingId: tointeger({}),
...

/*To save a selected row id in the readonly grid*/
...
          selectionValue: local!selectedMappingId,
          selectionSaveInto: {
            a!save(
              local!selectedMappingId,
              save!value
            )
          }
...

/*To save the complete selected row and selected row id*/
...
          selectionValue: local!selectedMappingId,
          selectionSaveInto: {
            a!save(
              local!selectedRow,
                fv!selectedRows
            )
          }

...

/*To check whether the id is in the selected list. The usage of this varies on  your scenario */
...
wherecontains(sav!value,local!selectedMappingId)
...

saahilm0001
Known Participant
Jul 15, 2021 7:04 AM UTC

Hi,

Thanks for clearing this. [emoticon:c4563cd7d5574777a71c318021cbbcc8]