question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property given on ViewXml of RenderListDataOptions under LoadListDataAsStreamAsync is not working as expected

See original GitHub issue

Category

  • Bug

Describe the bug

ViewXml provided with fields Like “ID” is not returned from LoadListDataAsStreamAsync operation. “ID” is just an example I have shared here with the example code below. However in my scenario provided list has around 80 fields, when applied all these fields under ViewXml during query with LoadListDataAsStreamAsync, only 60 fields and their values are returned.

Steps to reproduce


                int rowLimit = 200;
                bool paging = true;
                string nextPage = null;
                string viewXml = "<View><ViewFields><FieldRef Name='ID'/></ViewFields><RowLimit Paged='TRUE'>200</RowLimit></View>";
                var loadOption = new RenderListDataOptions()
                {
                    ViewXml = viewXml,
                    RenderOptions = RenderListDataOptionsFlags.ListData,
                    Paging = nextPage ?? null,
                    DatesInUtc = true,
                    FolderServerRelativeUrl = folderRelativeUrl
                };
                while (paging)
                {
                    var output = parentList.LoadListDataAsStreamAsync(loadOption).Result;

                    if (output.ContainsKey("NextHref"))
                    {
                        nextPage = output["NextHref"].ToString().Substring(1);
                    }
                    else
                    {
                        paging = false;
                    }
                }
               var result = parentList.Items.AsRequested();
                //here result[0].values misses the "ID" value.

Expected behavior

Method should have returned field values with all the provided fields.

Environment details (development & target environment)

  • SDK version: [1.3.0 ]
  • OS: [Windows 10]
  • SDK used in: [Console App]
  • Framework: [ .NET Framework v4.7.2 ]
  • Tooling: [Visual Studio 2019]

Additional context

Thanks for your contribution! Sharing is caring.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jansenbecommented, Sep 23, 2021

@gopaldahal : I’m closing this issue as what’s returned by a caml query is beyond my scope to change here, in my testing I see all properties being returned, so weird you always miss the Edit field.

Would also strongly recommend to give the current nightly a go as there have been massive perf improvements that will help with speeding up the reading of list data. Check the changelog and commit history to learn more.

0reactions
gopaldahalcommented, Sep 17, 2021

@jansenbe: If you are sure that SharePoint on itself does not return computed fields (when explicitly asked), I have no problem closing this one.

Retired again regarding “Edit” property, but still not retrieved on my end( no view fields specified). https://comparetext.codersup.com/shareUrl/b84fe267-a344-432f-a568-4ed0e4eeb44e

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't update list item · Issue #399 · pnp/pnpcore
I'm able to update the list item, when I'm getting it in the following way: await list. LoadListDataAsStreamAsync(new RenderListDataOptions() { ...
Read more >
Working with list items | PnP Core SDK
Using the LoadListDataAsStreamAsync method gives you the most control over how to query the list and what data to return. Using this method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found