# Not able to sort the records properly while Export

**URL:** <https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [March 24, 2025, 6:15am UTC](https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497 "2025-03-24T06:15:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubspotAWS](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hubspotAWS](https://community.hubspot.com/u/hubspotAWS)\
**Post date:** [March 24, 2025, 6:15am UTC](https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497/1 "2025-03-24T06:15:04Z")

</div>

While using the export API endpoint under CRM, we are not able to sort the results in descending order although the document specifies it.

Just to confirm the documentation says that the order for descending should be DES.

Also the documentation states the request body should be of this format:

///Example request body  
{  
“exportType”: “VIEW”,  
“exportName”: “All contacts”,  
“format”: “xlsx”,  
“language”: “DE”,  
“objectType”: “CONTACT”,  
“exportInternalValuesOptions”: [“NAMES”, “VALUES”],  
“objectProperties”: [“email”, “firstname”, “lastname”],  
“associatedObjectType”: “COMPANY”,  
“publicCrmSearchRequest”: {  
“filters”: [  
{  
“value”: " [hello@test.com](mailto:hello@test.com)",  
“propertyName”: “email”,  
“operator”: “EQ”  
}  
],  
“query”: “hello”,  
**“sorts”: [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“propertyName”: “hs\_object\_id”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“order”: “DES”  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;]**  
}  
}

Can you please let us know about this issue ASAP.

Thanks & Regards,

Hubspot AWS Team

---

<div class="post-metadata">

**Author:** ![Josh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josh/32/17115_2.png) [@Josh](https://community.hubspot.com/u/Josh)\
**Post date:** [March 24, 2025, 1:02pm UTC](https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497/2 "2025-03-24T13:02:24Z")

</div>

Hi @hubspotAWS,

Instead of DES, try using DESC:

“propertyName”: “hs\_object\_id”,  
“order”: “DESC”

Josh

---

<div class="post-metadata">

**Author:** ![hubspotAWS](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hubspotAWS](https://community.hubspot.com/u/hubspotAWS)\
**Post date:** [March 25, 2025, 5:44am UTC](https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497/3 "2025-03-25T05:44:34Z")

</div>

Tried that as well. But, it’s the same behaviour.

---

<div class="post-metadata">

**Author:** ![hubspotAWS](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hubspotAWS](https://community.hubspot.com/u/hubspotAWS)\
**Post date:** [March 28, 2025, 6:55am UTC](https://community.hubspot.com/t/not-able-to-sort-the-records-properly-while-export/128497/4 "2025-03-28T06:55:26Z")

</div>

Is there any other solution. Any help is appreciated!!!
