Question
a!forEach Not Working When Items Comes from Local Variable
I have a local variable that holds an array. When I pass this local variable to a a!forEach items, it does not loop. When I take the array value and paste it directly into items, it works. Why is it not working when I pass in the array from the local variable?
a!localVariables(
local!groups: {
cons!AX_ALL_USERS,
cons!AX_MECHANICS,
cons!AX_REGISTRARS,
cons!AX_SUPERVISORS,
cons!AX_ADMINISTRATORS_POINTER
},
{
a!sectionLayout(
label: "Groups for " & loggedInUser(),
contents: {
a!gridField(
label: "",
labelPosition: "ABOVE",
data: todatasubset(a!forEach(
/* WORKS */
items: {
cons!AX_ALL_USERS,
cons!AX_MECHANICS,
cons!AX_REGISTRARS,
cons!AX_SUPERVISORS,
cons!AX_ADMINISTRATORS_POINTER
},
/* DOES NOT WORK */
/*items: local!groups,*/
expression: {
{
groupName: group(fv!item, "groupName"),
isMember: a!isUserMemberOfGroup(loggedInUser(), fv!item)
}
}
), fv!pagingInfo),
columns: {
a!gridColumn(label: "Group Name", value: fv!row.groupName.),
a!gridColumn(label: "Member?", value: fv!row.isMember)
},
validations: {}
)
}
)
}
)