Issue with a!pickerFieldUsersAndGroups field use in editable grid a!gridRowLayout()

Certified Associate Developer

We have Appian 17.3 and 21.1 environments - I am using a!pickerFieldUsersAndGroups() field inside editable grid to allow users to pick either a user or a group. No issue when picking a user, but when I pick any group then I got the following error "Error in a!forEach() expression during iteration 1: Expression evaluation error at function a!pickerFieldUsersAndGroups [line 100]: A user and group picker component [label=“Primary Assignee”] has an invalid value for “value”. All users and groups must be valid and visible to the viewer."  

When I use a!pickerFieldUsersAndGroups() outside of the editable grid, picking a user or a group works with no issue.

Also, when using a!pickerFieldGroups() or a!pickerFieldUsers() inside editable grid works just fine.

Appreciate any help on this issue.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Chris

    Here is the editable grid with single field, populated by single text field CDT:

        a!gridLayout(
           label: "List of Assignees",
           emptyGridMessage: "",
           totalCount: count(ri!activeAssigneeList),
           instructions: "", 
           headerCells: {
             a!gridLayoutHeaderCell(label: "* Primary Assignee"),
           },
           columnConfigs: {
             a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1.5)
           },
           rows: a!forEach(
             items: ri!activeAssigneeList,
             expression: a!gridRowLayout(
               contents: {
                 a!pickerFieldUsersAndGroups(
                   label: "Primary Assignee",                     
                   maxSelections: 1,   
                   required: true,
                   groupFilter: cons!ALL_GRPS,
                   value: fv!item.priAssignee,
                   saveInto: {fv!item.priAssignee},
                   validations: {}
                 )
         },
               id: fv!index
       )
      )
     )

  • One thing I notice initially is that while you can use fv!item for the value of the picker, you cannot saveInto the fv!item instance of the a!forEach().  Instead you will want to save directly to the CDT.  Try this below with an updated saveInto:

        a!gridLayout(
          label: "List of Assignees",
          emptyGridMessage: "",
          totalCount: count(ri!activeAssigneeList),
          instructions: "", 
          headerCells: {
            a!gridLayoutHeaderCell(label: "* Primary Assignee"),
          },
          columnConfigs: {
            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1.5)
          },
          rows: a!forEach(
            items: ri!activeAssigneeList,
            expression: a!gridRowLayout(
              contents: {
                a!pickerFieldUsersAndGroups(
                  label: "Primary Assignee",                     
                  maxSelections: 1,   
                  required: true,
                  groupFilter: cons!ALL_GRPS,
                  value: fv!item.priAssignee,
                  /*saveInto: {fv!item.priAssignee},*/
                  saveInto: ri!activeAssigneeList[fv!index].priAssignee,
                  validations: {}
                )
              },
              id: fv!index
            )
          )
        )

  • 0
    Certified Associate Developer
    in reply to Chris

    Both methods worked...new value saved into the CDT just fine.

  • 0
    Certified Associate Developer
    in reply to Todd Tran

    For both saveInto methods, only selected user saved, selected group still same error.