Hi. I'm trying to create a selectable gridField similar to the one in this guide: https://docs.appian.com/suite/help/18.3/recipe_select_rows_in_a_grid.html. However, the gridField here only returns the IDs of selected users, which are profoundly less useful than, let's say, their name. How do I get local!gridSelection.selected to return a collection of names, titles, usernames or etc., instead of IDs?
Discussion posts and replies are publicly visible
Hi Daniel,
You can use the following example.
You are going to still save your Grid Selection with ids and you can use those ids as an index to retrieve the full element.
Add a test rule input as (Any Type).
Here's the solution I eventually came to. It's looks clunky, but it makes ri!test an accurate array of what you have selected.
saveInto: { local!gridSelection, a!save( ri!test, a!forEach( items: local!gridSelection.selected, expression: with( local!griditemid: fv!item, index( local!externalDataSubset.data, where( a!forEach( items: local!externalDataSubset.data, expression: { local!griditemid = index(fv!item, "id") } ) ) ) ) ) ) },
a!save(ri!test, index( local!datasubset.data, wherecontains( local!gridSelection.selected, index(local!datasubset.data,"yourIDField","") ) ) )
Your identifiers are going to be your primary key so you are finding in the data subset those indexes and you are going to save those indexes into your rule input.