In my company, we use Sharepoint list to request services to teams like IT, Marketing, HHRR, Quality and so on…
I want to automate some of those requests and, a very useful thing could be to obtain all the open requests form data without opening physically each list item so I’m trying with a “Get List Item” activity. But, for some of our forms data I’m getting “Microsoft.SharePoint.Client.FieldUserValue” so impossible to interact with it.
Sometimes I need to extract the name of the requester, or assign the request to someone by insertig the name of the employee on the field “ASIGNEDTO”. Sow can I do it?
How can I convert this data into a simply Generic Value or into String, Boolean, Int32…?
I’ve tried to convert this value to string, with an Invoke Method activity without success, by using sentences like “row(“REQUESTER”).ToString” or “row(“REQUESTER”).Value.ToString” without success. And, at the same time, I have no idea about how to insert a name (as Nuria Santos Carbonell" on "ASIGNEDTO field who’s type is FieldUserValue and not String.
I’vo found two or three topis about it on the forum but I can’t find a solution for my issue on any of them.
The SharePoint CSOM is rather complicated. But here is how you can do it.
First, make sure you are using the latest version of the UiPathTeam.SharePoint.Activities package. Should be 1.5.2 or later.
Next, you won’t be able to get the value from the DataTable. You’ll have to get the list using the Dictionary option. So for the Get List Items activity, use the Items(Dictionary Array) option.
Then you can get the value by doing something like:
Thanks, this part works fine to extract the data. I will need to modify again all the process to assign the queitems (I was using a bulk adding the data table of all the sharepoint list items) but at least I can obtain the data correctly.
What I’m still not able to do is to update those fields to assign someone to the “ASIGNEDTO” field for example. I receive this error:
I’ve tried some possibilities with information found on:
and
Without any success.
It indicates me that a string cannot be converted to FieldUserValue. I’ve tried with Assign activities with different expressions, with an invoke method and an invoke code but I’m not able to convert it so I can’t fill the field.