=load( local!selectedEmployeeId, local!employeeData: { {id: "john.smith", first: "John", last: "Smith", email: "john.smith@example.com", active: true()}, {id: "michael.johnson", first: "Michael", last: "Johnson", email: "michael.johnson@example.com", active: true()}, {id: "elizabeth.ward", first: "Elizabeth", last: "Ward", email: "elizabeth.ward@example.com", active: false()} }, local!gridSelection: a!gridSelection( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 25, sort: a!sortInfo( field: "boolean", ascending: true ) ) ), with( /* Replace the value of local!datasubset with your query rule, or queryrecord(), * or use your own CDT array in todatasubset() */ local!datasubset: todatasubset(local!employeeData, local!gridSelection.pagingInfo), a!formLayout( label: "SAIL Example: Limit Grid Selection to One Row", instructions: local!gridSelection, firstColumnContents:{ a!gridField( label: "Employees", totalCount: local!datasubset.totalCount, selection: true, identifiers: index(local!datasubset.data, "id", {}), columns: { a!gridTextColumn(label: "First", field: "first", data: index(local!datasubset.data, "first", {})), a!gridTextColumn(label: "Last", field: "last", data: index(local!datasubset.data, "last", {})), a!gridTextColumn(label: "Email", field: "email", data: index(local!datasubset.data, "email", {})), a!gridTextColumn(label: "Active", field: "active", data: index(local!datasubset.data, "active", {})) }, validations: if(count(local!gridSelection.selected)>1, "You may only select one employee", null), value: local!gridSelection, saveInto: { local!gridSelection, if( count(local!gridSelection.selected)>1, {}, /* Does not update the value if the user is attempting to select more than one id */ local!selectedEmployeeId << index(_, "selected", null) /* Shows how to store the selected id only */ ) } ) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidgetSubmit(label: "Submit") ) ) ) )