Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Search for files by a list

5 REPLIES 5
Reply
Message 1 of 6
jparks_79
1001 Views, 5 Replies

Search for files by a list

Hello out here,

 

Has anyone worked on a tool that would allow you to search the vault database for a specific list of file names? Or maybe some sample code that would get me started?

 

For example, lets say i have text file with 100 file names listed. I need to find those specific files.  I would be interested in a query to search for those file names only. I would essentially need to check out these files out or modify properties of these files.

 

Thanks,

Jeremy

5 REPLIES 5
Message 2 of 6
jan.liska
in reply to: jparks_79

You can use DocumentService.FindFilesBySearchConditions to search for file by specified filename. The name of property is ClientFileName. You can specify multiple conditions if required - API supports both AND (SearchRuleType.Must) and OR (SearchRuleType.May).

 



Jan Liska
Solution Architect
Autodesk, Inc.
Message 3 of 6
Redmond.D
in reply to: jan.liska

I'm not sure if the search mechanism can scale to hundreds of files.  The search featured wasn't designed for this type of query.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 4 of 6
jparks_79
in reply to: Redmond.D

Hi Doug,

 

It is a pleasant surprise to gain the interest of someone such as yourself. As i have spent a lot of time reading through many of your articles. 🙂  They are very helpful.

 

But in regards to my search request, do you think there is any way to accomplish this via api or any other programmming? We are using SAP erp system. We are frequently using this type of search when the part numbers are already known vs searching by some varying properties and then selecting the ones we want through a list.

 

It is almost common for us to get a list of part numbers from someone asking for us to make changes. This can range from 1 part number to 200 or even 1000. This type of search could be very helpful for our design dept.

 

I am not a programer by far. I just this might be something that someone might have already started to work on or maybe had a little snippet of code that could get me on my way 🙂

 

Thanks for the help guys!

Jeremy

 

 

Message 5 of 6
Redmond.D
in reply to: jparks_79

Try the GetLatestFilePathsByNames (...) function in the DocumentService.  That might be the thing you want.

You give it a set names and it returns all the files in Vault with one of those names.  If you have the "unique file names" setting turned on, then you should get no more than one path per file name.

 

What I don't know offhand is what happens if there no file in Vault that matches a name you passed in.  Hopefully it returns empty data, but it could result in an Exception from the server.  You will have to test this out.

 

I don't have an example of this exact function, but the VaultList sample in the SDK shows you how to set up a connection to the Vault server and make API calls.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 6 of 6
jparks_79
in reply to: jparks_79

Thanks Doug!

 

i will give it a try and see how far I get.

 

Thanks again!

Jeremy

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report