Function findcontentbyattribute() - Search Children Folder inside another folder

Hi Guys,

 

Does anyone know what is the correct syntax of the function findcontentbyattribute() to search a folder inside a root folder?

I've already tried the following syntax:

- findcontentbyattribute(false(), "folder", "name", pv!folderName, pv!rootFolder), where pv!folderName is Text and pv!rootFolder is of the Folder type. The function returns an empty value despite de folder referenced by pv!folderName exist.

The syntax described on plug-in page is : findcontentbyattribute( searchAllContent, contentType, attributeName, searchCriteria, [rootFolder, ][rootKC] ) - however I don't understand how to define the fifth parameter.

Do you have some hints?

 

Thanks

  Discussion posts and replies are publicly visible

Parents
  • please have a look on the documentation of the function as follows,


    findcontentbyattribute(searchAllContent, contentType, attributeName, searchCriteria, rootFolder, rootKC)
    Searches from a root folder and returns a list of all content (folders, documents) matching the specified attribute
    Returns: List of Content
    searchAllContent (Boolean): If true, searches all content (KCs and folders). If false, search only within the specified rootFolder or rootKC.
    contentType (Text): Type of content to search - valid values are "document" or "folder"
    attributeName (Text): Name of attribute to search for - valid values are "name", "author", "description" (works for Document only), "extension" (works for Document only)
    searchCriteria (Text): Value of attribute to search for
    rootFolder (Folder): If searchAllContent is false, a rootFolder or rootKC must be specified. If both rootFolder and rootKC are provided, rootFolder will be used.
    rootKC (Knowledge Center): If searchAllContent is false, a rootFolder or rootKC must be specified. If both rootFolder and rootKC are provided, rootFolder will be used.
  • It's strange because if you choose to search for folder there is no possible "attributeName" ?
  • 0
    A Score Level 1
    in reply to fredericom
    If we want to search for folder we need to pass the values as follows for contentType :folder and attributeName :name so it will search for the given folder
Reply Children
No Data