Skip to main content
July 24, 2025
Question

Expression Evaluation in rule - A User and group Picker component [label ='']has an invalid value for value. All users and groups must be valid and visible to the viewer

  • July 24, 2025
  • 5 replies
  • 0 views

Hi,

I am getting above error while selecting user for task assignment on the interface.

a!pickerFieldUsersAndGroups(
value: rule!<rulename>(
fv!item.Assignee
),

Rule code

if(
rule!APN_isBlank(
ri!userOrGroup
),
null,
if(
charat(
tostring(
ri!userOrGroup
),
1
) = "[",
togroup(
ri!userOrGroup
),
touser(
ri!userOrGroup
)
)
)

    5 replies

    harshas2775
    July 24, 2025

    Looks like some values in fv!item.Assignee is not having a valid username/ group name.

    I was able to reproduce the error you are getting when I pass a value which is not an Appian username in the environment. Code wise everything looks good and its working for me. So check the data in this Assignee field for any extra characters or invalid data in it which is not a valid username/group name. 

    To debug/validate data or find the wrong usernames you can use the function isusernametaken(fv!item.Assignee) to see for which data set it returns false. 

    To validate group names you can use a!doesGroupExist(ri!userOrGroup) function

    July 24, 2025

    Hi [mention:65b14048184a4eb5aff3a76c87b97431:e9ed411860ed4f2ba0265705b8793d05] Thanks for your response.

    I tried, but somehow unable to debug. Sorry I am new to Appian

    harshas2775
    July 24, 2025

    No need to be sorry, we are here to help!

    Firstly you can check the values in the Assignee column of your list. 
    In the pickerFieldUsersAndGroups() code that you have on your interface, can you try the below code and check the results. 

     a!pickerFieldUsersAndGroups(
        instructions: a!foreach(
          local!list, /*Replace with the list you have in your foreach()*/
          if(
            rule!APN_isBlank(fv!item.Assignee),
            null,
            if(
              charat(tostring(fv!item.Assignee), 1) = "[",
              a!doesGroupExist(tointeger(fv!item.Assignee)),
             
              isusernametaken(fv!item.Assignee)
            )
          )
        ),

    In my case as you can see here I have the output like this 

    In the instructions I have false at index 3 which means 3rd item in the list is invalid. Similarly check for your list which all values in the Assignee field is invalid. 

    P.S. as the list will have group id and not the name, I have updated previous answer to check valid groups using a!doesGroupExist() instead of a!groupsByName(). 

    shubhama926776
    July 24, 2025

    The error occurs because some values in fv!item.Assignee are not valid Appian usernames or group names. Your code is correct, But invalid or extra characters in the data cause this issue.
    Validate username and Group before passing it to pickerField.

    stefanhelzle0001
    July 24, 2025

    This makes your code much more readable.

    You will have to add code that checks whether the result is a valid user.