if you are looking for this ->

a!localVariables(
/*/make sure ri!data is notnull*/
local!fields: a!keys(index(ri!data, 1, "")),
local!selection,
local!selectedRows,
{
a!gridField(
label: "Performance Review Schedule",
labelPosition: "ABOVE",
data: ri!data,
columns: {
a!forEach(
items: local!fields,
expression: a!gridColumn(
label: fv!item,
value: index(fv!row, fv!item, "")
)
)
},
pagesize: 10,
selectable: true,
selectionValue: local!selection,
selectionSaveInto: {
local!selection,
a!save(
local!selectedRows,
append(local!selectedRows, fv!selectedRows)
),
a!save(
local!selectedRows,
difference(local!selectedRows, fv!deselectedRows)
)
}
),
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextItem(
text: if(
a!isNullOrEmpty(local!selectedRows),
"0/" & length(ri!data) & " records selected",
length(local!selectedRows) & "/" & length(ri!data) & " records selected"
)
)
}
),
a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Delete",
icon: "trash-solid",
style: "DESTRUCTIVE",
disabled: a!isNullOrEmpty(local!selectedRows)/*saveInto: here is logic for delete*/
),
a!buttonWidget(
label: "seprate",
icon: "code",
style: "NORMAL",
/*saveInto: here is logic for seprate*/
showWhen: not(or(ri!isOnlyDelete)),
disabled: a!isNullOrEmpty(local!selectedRows)
)
},
align: "START"
)
}
)