cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: ListFolderAsync Order Entries by Name

ListFolderAsync Order Entries by Name

Coffeecat
Helpful | Level 6

I got this one running.

DropboxClient.Files.ListFolderAsync(<"">).Result.Entries


Now how do I get the entries listed by name in descending order? There's this OrderBy(of ) function on Entries but I don't know what parameter to put.

3 Replies 3

Greg-DB
Dropbox Staff

To list the contents of a particular path, make sure you implement both ListFolderAsync and ListFolderContinueAsync, as described in the ListFolderAsync documentation. You aren't guaranteed to get everything in one call, so you need to process everything, using both methods, as described there.

Once you've retrieved all of the entries and processed them as instructed, you can sort the results however you want. Exactly how you would do so depends on your app, but it sounds like you probably want to sort by Metadata.Name.

dropdev
Explorer | Level 3

ListFolderAsync function is bad ...

 

the site show:

 

dropdev_0-1649281916582.png

 

the ListFolderAsync function:

 

dropdev_2-1649281959540.png

 why??

 

 

Greg-DB
Dropbox Staff

@dropdev The Dropbox web site does not work exactly the same way as the Dropbox API. The ListFolder[Continue] functionality does not guarantee a particular ordering. Make sure you implement the API calls as documented to make sure you get a correct representation of the listing. You can then apply whatever sorting/ordering you want client-side.

Need more support?