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: 

Import items and assign properties

6 REPLIES 6
Reply
Message 1 of 7
tmccar
564 Views, 6 Replies

Import items and assign properties

Using an SQL database of 100,000 items with 5 user-defined properties (or an Excel spreadsheet of the same), how can I programmatically import the items to Vault and assign the UDPs? Even if it requires 2 different programs, that's fine.

6 REPLIES 6
Message 2 of 7
Redmond.D
in reply to: tmccar

Do these Items need to be hooked to Files?  If yes, than it's very difficult to do.

 

If the Items are not hooked to any files, then it's much easier.  You can manually create the UDPs.  Next format the SQL data in a CSV file.  Lastly use the Import command to create the items in Vault.  However I don't recommend doing all 100,000 in a single import.  That will probaby time out.  Doing about 1000 at a time should be safe.

 

At the API level, you can use the PackageService to do the import.  Or you could use the ItemService to add the items 1 by 1 and set their properties.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 7
tmccar
in reply to: Redmond.D

Around one third of the items will be hooked to files, and these will have UDPs assigned to them.  Maybe I should consider UpdateFileProperties in the API, with an array of all the filenames.

Message 4 of 7
Redmond.D
in reply to: tmccar

How where the files added?  If they were added through Autoloader or a CAD client, then they should have BOM data already.  Running the Assign Item command (PromoteFiles in the API) will create the appropriate Items.  After that is done you can edit the Items and add in extra properties if needed.

 

File properties do NOT map directly to Item properties.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 5 of 7
tmccar
in reply to: Redmond.D

Yes, I was going to assign items to the files, but the customer wants all the records from his old SQL drawing database to be loaded in Vault, so Items may be the best way to do it.     

They were added in Autoloader but they have a lot of extra metadata that does not appear in Vault (so I created UDPs for all these fields).  

 

  "File properties do NOT map directly to Item properties."... Does this mean that you can't programmatically associate a file with an item after it's created?

Message 6 of 7
tmccar
in reply to: tmccar

You are right Doug - it times out for anything over 1000 items. But even after reading the 1000-item csv file, when I try to "commit items", it just says "cannot import" for each one.

Message 7 of 7
tmccar
in reply to: tmccar

Sorry - there was a conflict between the headings in the csv file and the UDP names. It's now fixed.

 

Tom

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

Post to forums  

Autodesk Design & Make Report