Hi
(different uses of the word “object” coming up!)
Using the “Get Object Properties” activity within the UiPath Active Directory Activities, I am trying to extract the “proxyAddresses” attribute for a user in AD. Variable type assigned as Object and it seems to get the property fine. (variable is UserProxyAddresses)
I try to display this in a log file (UserProxyAddresses.ToString) and all i get is “system.object”
So this suggests to me that the variable is actually an array of objects… am I correct? However, if I try to handle as an array I’m just getting errors as well.
Please, tell me how I get the actual values to display.
An array of strings (if multiple addresses exist).
UiPath treats both as Object, so you need to check the runtime type before casting.
Always type check before casting…
Use an If activity to check the runtime type of UserProxyAddresses :
If TypeOf UserProxyAddresses Is String Then
proxylist = {UserProxyAddresses.ToString}
ElseIf TypeOf UserProxyAddresses Is IEnumerable Then
proxylist = DirectCast(UserProxyAddresses, IEnumerable).Cast(Of String).ToArray
Else
proxylist = {}
End If
This ensures:
Single string → wrapped in array.
Multiple strings → cast safely.
Unexpected type → fallback to empty array.
Then display value using log message or write line activity:
String.Join(“,”, proxylist)
Please try this step and let us know your result.
If this solves your issue, kindly mark it as solution to close the case.