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
  • The problem is likely due to the data type of the field that you're saving into. Appian does a pretty good job of casting back and forth between the Text and User types, but the group is usually stored as an integer. So suppose you save a group with ID 10 into your variable. Now the variable stores the result as "10". However, if there's text, Appian assumes the result is a user, and it doesn't find any user name called "10".

    I think you'll need to temporarily store the results into a local variable (since that can accept any type). Then, on saving the results, cast everything in the list to text and save to your CDT. This also means you'll need to cast back whenever you query this information from the database to ensure the results are returned as users and groups instead of text.

Reply
  • The problem is likely due to the data type of the field that you're saving into. Appian does a pretty good job of casting back and forth between the Text and User types, but the group is usually stored as an integer. So suppose you save a group with ID 10 into your variable. Now the variable stores the result as "10". However, if there's text, Appian assumes the result is a user, and it doesn't find any user name called "10".

    I think you'll need to temporarily store the results into a local variable (since that can accept any type). Then, on saving the results, cast everything in the list to text and save to your CDT. This also means you'll need to cast back whenever you query this information from the database to ensure the results are returned as users and groups instead of text.

Children
No Data