You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Ashley B.15's avatar
Ashley B.15
Helpful | Level 7
6 years ago

Add custom metadata to folder

I see you can add properties to a file, is there anything availble for folders?

  • Ashley B.15's avatar
    Ashley B.15
    6 years ago

    Sorry, sorted this. Should be 

     

    List<PropertyFieldTemplate> p = new List<PropertyFieldTemplate>(){
    new PropertyFieldTemplate("FieldName", "FieldDesc", String.Instance),
    };

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The /2/file_properties/properties/add endpoint can be used to add properties to folders, but only for user-owned templates. It doesn't support adding properties to folders for team-owned templates.

    If you do want to use team-owned templates for this, let me know and I'll pass this along as a feature request.

    • Ashley B.15's avatar
      Ashley B.15
      Helpful | Level 7

      Hi Greg,

      Thanks for getting back to me. I'm currently trying to create a Template using the NET SDK .FileProperties.TemplatesAddForTeamAsync

      How do you set the property type? I'm using the following

      List<PropertyFieldTemplate> p = new List<PropertyFieldTemplate>(){
      new PropertyFieldTemplate("FieldName", "FieldDesc", new PropertyType().AsString),
      };

      When I use new PropertyType().AsString it returns null. Not sure how I should set this. Thanks

      • Ashley B.15's avatar
        Ashley B.15
        Helpful | Level 7

        Sorry, sorted this. Should be 

         

        List<PropertyFieldTemplate> p = new List<PropertyFieldTemplate>(){
        new PropertyFieldTemplate("FieldName", "FieldDesc", String.Instance),
        };