Server

HOWTO: Populate a Directory With a CSV File

Updated: December 2, 2024

Nuxeo Platform allows you to upload a CSV file through Automation to populate a directory.

This could be used to load directory entries while Nuxeo is running.

  1. Prepare a CSV file representing the data you want to load, let's name it data.csv.
    For example, on a vocabulary, the content should look like below:

    id, label, obsolete, ordering
    1,A,0,1
    2,B,0,2
    
  2. Now you can use cURL to post this file along with the automation parameters to Directory.LoadFromCSV:

    curl -XPOST -u Administrator:Administrator -F request='{"params":{"directoryName":"DIRECTORY_NAME", "dataLoadingPolicy":"skip_duplicate"}, "context":{}}' -F '[email protected]' http://NUXEO_SERVER/nuxeo/site/automation/Directory.LoadFromCSV
    

    We used the skip_duplicated in order to not corrupt existing data, there're other policies.