How to retrieve value of the column instead of Microsoft.SharePoint.Client.FieldUserValue

Hi,

For everyone who can also have this issue, I’ve the solution to extract and to insert this data.

To extract the data, the solution provided by @oddrationale on my post “Getting "Microsoft.SharePoint.Client.FieldUserValue" with Get List Items Sharepoint activity” works fine, we must extract the Sharepoint list item data with the dictionary option and use this sentence to extract its value:

CType(OutputDict(0)(“REQUESTER”), Microsoft.SharePoint.Client.FieldUserValue).LookupValue

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.

I’ve used it like this:

image

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.")
1 Like