Getting Items of MFFolderContentItemTypePropertyFolder

Hello,

I would like to get contents of MFFolderContentItemTypePropertyFolder of a view as shown in the attached image and also how do I get the ID 15. Thank you

Parents
  • This is a grouping.  The grouping exists within a view.  You get the contents of the view (e.g. via GetFolderContents) which will return you potentially different types of things, including the groupings.  For the groupings they have details on the TypedValue that represents the actual group.  In the case of the screenshot you should have something representing the Agenda grouping, and a TypedValue which has the display name of "Agenda" and a lookup value of 15.

  • You use GetFolderContents again.  That method takes a collection of FolderDef instances and you provide one instance of FolderDef for each "level" of the path.  So you would provide one for the top-level view, one for each subview, and one for each grouping level you want to list.

  • Actually, I am unable to set the level for an example how do I pass it in this code

    FolderDefs folderDefs = new FolderDefs();
    var folderDef = new FolderDef();
    folderDef.SetView(view.ID);

    folderDefs.Add(-1, folderDef);
    var mfilesSearchResult = vault.ViewOperations.GetFolderContents(folderDefs);

  • // Create the collection of folder defs.
    // We need to add one entry in here for each part of the path from the vault root.
    FolderDefs folderDefs = new FolderDefs();
    
    // For this sample let's assume it's "M:\Sample Vault\By Class\Agenda"
    // where "by class" is a view with ID 123, and "agenda" is a grouping with class 456.
    
    // Set up the "by class" view.
    {
        var folderDef = new FolderDef();
        folderDef.SetView(123);
        folderDefs.Add(-1, folderDef);
    }
    
    
    // Set up the "agenda" grouping.
    {
        // Set up a typed value to represent what the grouping is.
        // This depends upon the view structure; not everything will be a grouping by a lookup!
        var typedValue = new TypedValue();
        typedValue.SetValue(MFDataType.MFDataTypeLookup, 456);
    
        var folderDef = new FolderDef();
        folderDef.SetPropertyFolder(typedValue);
        folderDefs.Add(-1, folderDef);
    }
    
    // If we had more groupings or subviews or whatever then we would
    // continue to add to the folderDefs collection until
    // we've represented the entire path.
    
    // Get the folder contents.
    var mfilesSearchResult = vault.ViewOperations.GetFolderContents(folderDefs);

Reply
  • // Create the collection of folder defs.
    // We need to add one entry in here for each part of the path from the vault root.
    FolderDefs folderDefs = new FolderDefs();
    
    // For this sample let's assume it's "M:\Sample Vault\By Class\Agenda"
    // where "by class" is a view with ID 123, and "agenda" is a grouping with class 456.
    
    // Set up the "by class" view.
    {
        var folderDef = new FolderDef();
        folderDef.SetView(123);
        folderDefs.Add(-1, folderDef);
    }
    
    
    // Set up the "agenda" grouping.
    {
        // Set up a typed value to represent what the grouping is.
        // This depends upon the view structure; not everything will be a grouping by a lookup!
        var typedValue = new TypedValue();
        typedValue.SetValue(MFDataType.MFDataTypeLookup, 456);
    
        var folderDef = new FolderDef();
        folderDef.SetPropertyFolder(typedValue);
        folderDefs.Add(-1, folderDef);
    }
    
    // If we had more groupings or subviews or whatever then we would
    // continue to add to the folderDefs collection until
    // we've represented the entire path.
    
    // Get the folder contents.
    var mfilesSearchResult = vault.ViewOperations.GetFolderContents(folderDefs);

Children