KNOWLEDGE BASE ARTICLE

Index to Search and Select Folders

Umango Extract's standard folder browsing feature using the zone type "Export Field" feature is excellent in most instances. However, if you want users to be able to browse and select a folder from a large folder list it can be time consuming to find the right folder. It would be nice to be able to search for it wouldn't it? Well, you can. Sort of.

To allow users to search for the folder, you need to add an ODBC lookup and use SQL to query the folder structure. You can configure it as described below:

  • Create a new zone and select the "ODBC Data Lookup" zone type.
  • Select the "Build Lookup" option and create a connection to a local SQL server instance.
  • Select the Edit SQL option and paste in the SQL command below while ignoring all the other setup options.
  • Change the search path from "C:\my\folder\path" to the folder path you want the users to be able to search and select from (this is typically your export path as setup in your export connector).

SET NOCOUNT ON
declare @files table (subdirectory varchar(100), depth int, [file] int)
insert into @files execute xp_dirtree 'C:\my\folder\path',1,1
select subdirectory from @files where [file]=0 and subdirectory like %<SearchValue>%

Now you just need to assign your new index zone as a subfolder of the export directory.

Link to this article http://umango.com/KB?article=84