Importing selections from CSV

  • Is it currently possible to import fields that allow multiple selection?

    <document>.setItem requires a list, but always gets a string in importCsv

    It looks like the form's processInput may be a more appropriate API to call, otherwise other fields will also give problems.

  • Eric Brehault
    Eric Brehault


    indeed, you cannot import multivalued fields directly
    but after impor, you can use a small Plomino agent to split the string value and store an array
    let's assume your multivalued field is named "field1" and you use '|' as value separator, it would something like that:

    for doc in db.getAllDocuments():
      if doc.hasItem("field1"):
        v = doc.field1
        # is it a list ?
        if hasattr(v, 'append'):
          doc.setItem("field2", v.split("|")


  • Jean Jordaan
    Jean Jordaan

    You'd have to run an agent for all numbers, date-times .. all non-string fields .. which makes import from CSV less useful than it need be. The incoming data looks a lot like the data you get from form submission. Isn't it possible to treat it the same and get more useful CSV import?

  • Eric Brehault
    Eric Brehault

    yes good idea, and that's probably quite easy to do I think