How to retrieve lookup field value #795
Unanswered
pierodamafalda
asked this question in
Q&A
Replies: 3 comments 8 replies
|
Hey @pierodamafalda , Hope below can get you unblocked: var listTitle = "FieldTypes";
var list = await context.Web.Lists.GetByTitleAsync(listTitle, p=>p.Items);
var firstItem = list.Items.AsRequested().First();Looking inside |
2 replies
|
The second example doesn't work for me. I get this error (I have a document library not a custom list): "The given key was not present in the dictionary." " at System.Text.Json.JsonElement.GetProperty(String propertyName)\r\n at PnP.Core.Model.SharePoint.ListDataAsStreamHandler.Deserialize(String json, List list)\r\n at PnP.Core.Model.SharePoint.List.LoadListDataAsStreamAsync(RenderListDataOptions renderOptions)\r\n at Thanks. |
1 reply
|
I've created a CAML query and in ViewFields I set only the fields I need. I don't get that error anymore. Thanks. |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Hello, I am using the Pnp Core trying to read a lookup value in a sharepoint list without success. Do you have a working example?
My try is this:
but it result in an error:
'((IFieldLookupValue)d["Where"]).LookupValue' threw an exception of type 'PnP.Core.ClientException'
Thanks you
All reactions