Hi,
I’m trying to retreive the CreatedBy column (i.e Author) value from sharepoint using
ListItem(“Author”).toString
But the output is Microsoft.SharePoint.Client.FieldUserValue instead of actual value.
Can you please help me in retreiving the actual value.
When I searched, suggestions came as below:
(FieldUserValue)listItem[“Author”].lookupValue
Which is not allowed in Uipath.
Kindly suggest.
Thanks
By another side I’ve also found the way to insert data on those kind of fields but we must use an Invoke Code activity and insert a VB.NET code to interact with Sharepoint. Also, the user that we want to assign to the field must have the permissions (or have had it on the past) on the list where we want to add him.
And here is the code, I mark the things that must be replaced between asterisks (**), from my side, the only thing I’ve letted static on the code is the site URL because on my company it’s the same URL for all the requests declared to services teams (that we name “SFR”), the ones that starts by “IC_” are the In arguments of the activity:
Dim context As New ClientContext(**"http://our.sharepoint.url:PORT/SUBSITENAME"**)
Dim web As Web = context.Web
Dim collList As ListCollection = web.Lists
Dim oList As List
Dim existe As Boolean
existe = False
' Carga las listas del site GMC
context.Load(collList)
context.ExecuteQuery()
For Each oList In collList
If oList.Title = **IC_ListName** Then
existe = True
Exit For
End If
Next
Dim usuario As Microsoft.SharePoint.Client.User
usuario = web.SiteUsers.GetByEmail(**IC_UserMail**)
If existe Then
Dim query As New Microsoft.SharePoint.Client.CamlQuery
Dim itemList As ListItemCollection = oList.GetItems(query)
context.Load(itemList)
context.ExecuteQuery()
Dim oItem As ListItem
Dim existed As Boolean
existed = False
For Each oItem In itemList
If oItem.Id = **IC_ID** Then
existed = True
Exit For
End If
Next
If existed Then
usuario = web.SiteUsers.GetByEmail(**IC_UserMail**)
oItem("ASIGNEDTO") = usuario
oItem.Update()
context.ExecuteQuery()
End If
End If
Console.WriteLine("""Assigned to"" field updated. End of Invoked code.")
Hi @l.sambinelli I can’t check it to give you screenshots or detailed description right now because we’ve just purchased the Enterprise plan on my company and I’m having issues to connect my studio.
I think it’s because you don’t have the needed shareepoint collections on your Imports pannel. I was having the same problem and dealing with it during hours since I found the solution, try to check your Imports pannel to see if you can add more Sharepoint collections, if not, to add more options to your available collections on Imports pannel, you must download packages, the packages comes with collections, try to find Sharepoint packages for this. Another issue that I found too with this is that, sometimes, more than one collections uses same function names so you must use the complete collection+function name or delete one of the collections, if not, UiPath don’t know what of the two collections must be used and it gives an error similar to your error too.
As soon as I will be able to solve my issue with my Studio I will try to give you more details about it.
Thank you for your time!
i just found what was the problem. it’s a bug of UIPATH.
If i write the sequence in assign activity i receive that error but if i insert before of assign activity a simple log message activity with the same sequence the error disappear!!!
loris