Variable is not refreshing

Good afternoon all.

Here is what's going on.

I am given a string, or Text variable. This variable is used to store employee IDs. Although it is one variable, it can contain several IDs (or contain none). There is nothing I can do about this and I cannot change this. Now, I need to check if this value has any of the following: no values, one value, or many values. This Text can dynamically change when a user selects IDs, or removes them, from a custom picker. If the Text has several values, I am currently using split() to separate the IDs into an array, which is working fine. Then, I have a local variable that uses the array to get the names for each of those IDs. Unfortunately, the last ID is contained in the new array, but fails to update to the name. For example, if the following IDs exist: 1, 2, and 3, It will show: Peter, Paul, and 3. I'm currently using Appian 21.3.

local!employeeIDs: if(
    isnull(ri!record.employeeIDs),
    null,
    split(ri!record.employeeIDs, ";")
  ),	
local!employeeNames: a!refreshVariable(
    value: if(
      or(
        rule!isEmpty(local!employeeIDs),
        length(local!employeeIDs) = 0
      ),
      null,
      a!forEach(
        items: local!employeeIDs,
        expression: rule!GetNameByID(fv!item)
      )
    ),
    refreshOnVarChange: local!employeeIDs
  )

If I did a terrible job explaining my issue, please let me know. I will gladly elaborate on the issue. Any and all advice will be greatly, greatly appreciated. Thanks.

  Discussion posts and replies are publicly visible