Kytyzow
November 25, 2021, 2:52pm
1
Hello everybody,
I am using the UiPath.MicrosoftOffice365.Activities Package to access the contents of a SharePoint list.
I want to retrieve the content of a field, number 38. This has the field type lookup.
With ListItem.Fields(38).Value.ToString the value 1 is returned. In the SharePoint list the value “Test1” is visible.
How can the value visible in the SharePoint list be returned?
Yoichi
(Yoichi)
November 25, 2021, 3:02pm
2
Hi,
The following might help you.
Hi,
I recommend to use Dictionaty to extract content of ListItem.
First, create Dictionary<string,object> in ForEachListItem as the following
dict = ListItem.Fields.ToDictionary(Function(x) x.Name, Function(x) x.Value)
Then, for example,
dict("LinkTitle").ToString
returns value of LinkTitle.
We can also get list of key from dict.Keys
Hope this helps you.
Regards,
Regards,
Kytyzow
November 25, 2021, 3:09pm
3
I created a Dictionary Of String, Object and put the values in.
The result is a 1 as value in the dictionary.
Yoichi
(Yoichi)
November 25, 2021, 3:12pm
4
Hi,
Is there “Test1” at any other value in the dictionary?
Regards,
Kytyzow
November 25, 2021, 3:14pm
5
No, the field content is unique in this line.
This is how the field looks in SharePoint.
Kytyzow
November 25, 2021, 4:04pm
6
This is what else I found out. Depending on which content is selected in the SharePoint list, a different value is delivered. Everything is there, from 1 to 10.
It seems that the value is maybe also a kind of dictionary. Where the 1 corresponds to Test1.
Theoretically I can work with a mapping here, but it would be a workaround.
1 Like
system
(system)
Closed
December 6, 2021, 11:02am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.