Forum Discussion

Coffeecat's avatar
Coffeecat
Helpful | Level 6
7 years ago

ListFolderAsync Order Entries by Name

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    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's avatar
    dropdev
    Explorer | Level 3
    3 years ago

    ListFolderAsync function is bad ...

     

    the site show:

     

     

    the ListFolderAsync function:

     

     why??

     

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!