If I manually set a string variable to a valid upn this works ok
If I set a string variable to a valid people type field which contains valid data either as Login Name, User id the result give an error as described. I log to history and see the variable has I: o: membership ¦ at the beginning of the string but the user email is not formatted as text but underlined as in an email e.g Peter at contoso.com.
This seems to be done by Microsoft platform. I cannot find a way of returning the upn as a plain text field.
I have tried setting a var as the email address and then using the var value to construct a second string using the plain text value of the first var but this gives the same result.