function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Data Science 3Data Science 3 

Sorting columns in reports using a Python API

Hello!
I'm using a slightly modified version of the python salesforce_reporting package to download reports from salesforce.  The modification is to the script involves editing the json reporting metadata passed to the post request by adding an extra field "sortBy": [<api col name>, "Asc"] or "Desc" in accordance to https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_report_query.htm.  However this is not working and I'm wondering if anyone has had success.  I've tried variation of "Asc", "asc", "ASCENDING" but none of them work and it is not clear from the webpage what the correct thing to do is.   Thanks!
SandhyaSandhya (Salesforce Developers) 
Hi,

Try to use "sortOrder": "Desc", after SortBy.

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya