Skip to content

How can I determine if a ListItem field already has a value? #1229

Answered by adamfisher
adamfisher asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks Bert but it looks like the only way I was able to get the properties to load was by using the All property when loading the item:

IListItem item = await list.Items.GetByIdAsync(changeItem.ItemId,
      li => li.All,
      li => li.File.QueryProperties(f => f.Name, f => f.ServerRelativeUrl),
      li => li.Folder.QueryProperties(f => f.Name, f => f.ServerRelativeUrl));

It didn't load it with any other combination of properties I tried to load. Not sure if that is a bug or just the way the API works but feels hacky. I also tried li => li.Values but that produces an error.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jansenbe
Comment options

@adamfisher
Comment options

Answer selected by adamfisher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants