Incorrect row order when importing from OData

I'm trying to import some data via OData Data Feed.

Entity set "Users" has default sort by Username descending, so my OData service returns the following set of records (it is actual response to Excel captured by HTTP Debugger):

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="http://localhost/code/odata" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
  <id>http://schemas.datacontract.org/2004/07/</id>
  <title />
  <updated>2015-03-05T11:07:34Z</updated>
  <link rel="self" href="http://localhost/code/odata/Users" />
  <entry>
    <id>http://localhost/code/odata/Users('Wiley')</id>
    <category term="PX.Data.Users" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="http://localhost/code/odata/Users('Wiley')" />
    <link rel="self" href="http://localhost/code/odata/Users('Wiley')" />
    <title />
    <updated>2015-03-05T11:07:34Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:Login>Wiley</d:Login>
        <d:NoteText></d:NoteText>
        <d:FullName>Wiley, Regina</d:FullName>
        <d:DisplayName>Regina Wiley</d:DisplayName>
        <d:GuestAccount m:type="Edm.Boolean">false</d:GuestAccount>
        <d:LastLoginDate m:type="Edm.DateTime">2013-09-25T14:17:27.22</d:LastLoginDate>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost/code/odata/Users('vpanchenko')</id>
    <category term="PX.Data.Users" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="http://localhost/code/odata/Users('vpanchenko')" />
    <link rel="self" href="http://localhost/code/odata/Users('vpanchenko')" />
    <title />
    <updated>2015-03-05T11:07:34Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:Login>vpanchenko</d:Login>
        <d:NoteText></d:NoteText>
        <d:FullName>vpanchenko</d:FullName>
        <d:DisplayName>vpanchenko</d:DisplayName>
        <d:GuestAccount m:type="Edm.Boolean">false</d:GuestAccount>
        <d:LastLoginDate m:type="Edm.DateTime">2014-12-09T15:10:12.633</d:LastLoginDate>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost/code/odata/Users('Bloom')</id>
    <category term="PX.Data.Users" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="http://localhost/code/odata/Users('Bloom')" />
    <link rel="self" href="http://localhost/code/odata/Users('Bloom')" />
    <title />
    <updated>2015-03-05T11:07:34Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:Login>Bloom</d:Login>
        <d:NoteText></d:NoteText>
        <d:FullName>Bloom, Todd</d:FullName>
        <d:DisplayName>Todd Bloom</d:DisplayName>
        <d:GuestAccount m:type="Edm.Boolean">false</d:GuestAccount>
        <d:LastLoginDate m:type="Edm.DateTime">2015-02-17T09:02:08.87</d:LastLoginDate>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost/code/odata/Users('Andrews')</id>
    <category term="PX.Data.Users" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="http://localhost/code/odata/Users('Andrews')" />
    <link rel="self" href="http://localhost/code/odata/Users('Andrews')" />
    <title />
    <updated>2015-03-05T11:07:34Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:Login>Andrews</d:Login>
        <d:NoteText></d:NoteText>
        <d:FullName>Andrews, Michael</d:FullName>
        <d:DisplayName>Michael Andrews</d:DisplayName>
        <d:GuestAccount m:type="Edm.Boolean">false</d:GuestAccount>
        <d:LastLoginDate m:type="Edm.DateTime">2013-12-10T12:04:46.423</d:LastLoginDate>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost/code/odata/Users('admin')</id>
    <category term="PX.Data.Users" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="http://localhost/code/odata/Users('admin')" />
    <link rel="self" href="http://localhost/code/odata/Users('admin')" />
    <title />
    <updated>2015-03-05T11:07:34Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:Login>admin</d:Login>
        <d:NoteText></d:NoteText>
        <d:FullName>admin, admin</d:FullName>
        <d:DisplayName>admin admin</d:DisplayName>
        <d:GuestAccount m:type="Edm.Boolean">false</d:GuestAccount>
        <d:LastLoginDate m:type="Edm.DateTime">2015-03-05T11:07:34.79</d:LastLoginDate>
      </m:properties>
    </content>
  </entry>
</feed>

But Excel shows me the records in totally different order: Wiley, admin, Andrews, Bloom, vpanchenko (I will attach the screenshot after my account is activated).

Why does Excel alter original order of records from OData feed?

March 6th, 2015 3:47am

My guess is that Excel loads the data by simultaneously fetching different ranges.

You can consider using Power Query add-in which can be configured to turn off parallel loading.

Read more here.

Microsoft Power Query for Excel is available for free on Excel 2010, 2013 and Office 365 Professional Plus and Excel Standalone. Download it here.

Free Windows Admin Tool Kit Click here and download it now
March 9th, 2015 2:37am

My guess is that Excel loads the data by simultaneously fetching different ranges.

You can consider using Power Query add-in which can be configured to turn off parallel loading.

Read more here.

Microsoft Power Query for Excel is available for free on Excel 2010, 2013 and Office 365 Professional Plus and Excel Standalone. Download it here.

March 9th, 2015 6:35am

I've examined the requests from Excel using Fiddler/HTTP Debugger, unfortunately it fetches all the range in single request.

Of course I can use Power Query, but my question is about "vanilla" Excel. If it is a bug, could it be reported to Excel development team?

Free Windows Admin Tool Kit Click here and download it now
March 10th, 2015 11:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics