Welcome to posman community.
The issue is when you store something in environment or from test script it is stored as a string that’s the reason you get the length as 39.
There are 2 ways to handle this
Use the split function to store it in a array like this
let Users = pm.environment.get(‘UserId’);
let UsersArr = Users.split(",");
After this you can access values under UsersArr as UsersArr[0] & the length will be 3.
If you are extracting users from a API call, either chain it to next request or save each value individually rather than a array.
Let me know if this works for you.
Regards,
Skandh