Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

martindart's avatar
martindart
Explorer | Level 3
8 years ago

list_folder does not contain property_group

Hi,

I just want to ask why Property_Group is null even though I'm expecting some values. I'm using .Net sdk - list_folder method.  Please see the the image below:

 

 

Thanks!

8 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Can you share the code that's not working for you? That is, the call where you're adding properties to this file, and the output from that, as well as the list_folder call? Thanks in advance!
  • martindart's avatar
    martindart
    Explorer | Level 3
    8 years ago
    Hi Greg,

    Sure thing, here it is:

    add property (https://api.dropboxapi.com/2/file_properties/templates/add_for_user)==================================================================

    {
    "name": "Vendor Custom Properties",
    "description": "These are custom property for each accounts.",
    "fields": [
    {
    "name": "DateUploaded",
    "description": "This is the original Date of the file uploaded",
    "type": {
    ".tag": "string"
    }
    },
    {
    "name": "Author",
    "description": "This is the original Author of the file uploaded",
    "type": {
    ".tag": "string"
    }
    }
    ]
    }



    Call to list_folder=========================================================

    curl -X POST https://api.dropboxapi.com/2/files/list_folder \ --header 'Authorization: Bearer <token here>' \ --header 'Content-Type: application/json' \ --data '{"path":"/Apps/Workorder_QA/Documents"}'



    RESPONSE=========================================================================
    { "entries": [ { ".tag": "file", "name": "Test Attachment 1 Small_636438665288743768.docx", "path_lower": "/apps/workorder_qa/documents/test attachment 1 small_636438665288743768.docx", "path_display": "/Apps/WorkOrder_QA/Documents/Test Attachment 1 Small_636438665288743768.docx", "id": "id:4-ydy_dUzQAAAAAAAAAAiw", "client_modified": "2017-10-18T02:48:50Z", "server_modified": "2017-10-18T02:48:50Z", "rev": "1235d400473", "size": 11274, "content_hash": "96ce589548047eb8e2f748dc21093c2334b189dbf8a5f71f786272a483b5b7de" } ], "cursor": "AAFygHNnj6xgvLIV8p4YySC42UxZlQHJxQZ-dRObkc5EY21mu430xQJB9Vj0KxFIzIhXi2Ws7s-D8_qjGgzFc2jWlojmjSxnQiM2Bk1kKgbFOWvLlyUaWAbFbFmFaIui8GyJIoyWuXYCqfan7sWH0m8AK4DbGOeViUUeQd0HVf2ZLzljRtHAn7cSkVkjy4laxPkbI76YDTcl-h5phorvYLrV75ILmTAxBPLfYeGc8Eko2qpQnJoEB-HdphBokLXDL4c3kwznlMDYj2f72B3IcAW-w5P4wOND3j5nXyNyuTP7lA", "has_more": false }

    Thank you!
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    Thanks! I see you're adding the template for the user, and then are listing the files for the user, but it seems you're missing the step of setting the values for that template for the desired file(s). That is, you're missing step 2 below:

     

    The basic flow would be like this:

    1. Call /2/file_properties/templates/add_for_user to add a template.
    2. Call/2/file_properties/properties/add to add property groups for that template to a file (or repeatedly for multiple files).
    3. Call /2/files/list_folder (or /2/files/get_metadata, etc.) later to read them back when listing files.
  • martindart's avatar
    martindart
    Explorer | Level 3
    8 years ago
    Thanks! Sorry I forgot to show you that code in my last post but we were able to add the property to the file, the problem is retrieving.

    The steps we did were:
    upload file via /upload
    update file property via /property/add
    /list_folder to get the folder content with metadata.

    This doesn't contain the "property_groups". However, if you use the /alpha_getmeta it will show you the file metadata together with the "property_groups".
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Apologies, I was misinformed in my last reply.

    The property groups aren't supposed to be returned in list_folder (they documentation only shows it because the FileMetadata type sample itself is re-used).

    The intent is that they would only be returned by get_metadata when specifying `include_property_templates`. The feature is new though, and we haven't finished rolling it out to the non-alpha endpoint. That will be coming in the future, though I don't have a specific timeline right now.

    Sorry again for the earlier inaccurate information!
  • martindart's avatar
    martindart
    Explorer | Level 3
    8 years ago

    Hi,

     

    I see, no worries.  Thank you very much for responding and clarification :)

     

    Regards

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!