0
Answered

CSV connector with multivalued attributes

Adrian Corston 4 years ago in CSV connector updated by Matthew Davis (Technical Product Manager) 4 years ago 4

Is it possible to have multivalued attributes in a CSV connector?

Answer

Answer
Answered

Hey Adrian,

The CSV connector does support multi value attributes. If you wrap the mutli value column in quotes, and comma separate each value inside that column, the connector will import into a multi value field - as long as you set the connector schema to the appropriate multi value that you're after. 

For example, a CSV like so:

id,name,data
1,user1,"value1,value2,value3,value4"
2,user2,"value1,value2,value3,value4"
3,user3,"value1,value2,value3,value4"
4,user4,"value1,value2,value3,value4"
5,user5,"value1,value2,value3,value4"

will return "value1, value2, value3, value4" as 4 different values inside the multi value string schema field "data".

GOOD, I'M SATISFIED
Satisfaction mark by Adrian Corston 4 years ago
Answer
Answered

Hey Adrian,

The CSV connector does support multi value attributes. If you wrap the mutli value column in quotes, and comma separate each value inside that column, the connector will import into a multi value field - as long as you set the connector schema to the appropriate multi value that you're after. 

For example, a CSV like so:

id,name,data
1,user1,"value1,value2,value3,value4"
2,user2,"value1,value2,value3,value4"
3,user3,"value1,value2,value3,value4"
4,user4,"value1,value2,value3,value4"
5,user5,"value1,value2,value3,value4"

will return "value1, value2, value3, value4" as 4 different values inside the multi value string schema field "data".

The UI entity search capability doesn't render multi value fields very well, so if you want to check that your read has been processed correctly you can use the /Entity/SearchEntities API endpoint:

POST http://localhost:59991/IdentityBroker/api/1.0/Entity/SearchEntities?partitionId=fddc9fca-fb44-4013-a92f-80224e762f56

Should return something like this, where you can see the array of values under the appropriate schema field:

{
  "Entities": [
    {
      "EntityId": "37995d62-b0ee-49f2-8ca1-073d4451b829",
      "DN": null,
      "CreatedTime": "0001-01-01T00:00:00",
      "ModifiedTime": "0001-01-01T00:00:00",
      "Values": {
        "id": "5",
        "name": "user5",
        "data": [
          "value1",
          "value2",
          "value3",
          "value4"
        ]
      }
    }
  ],
  "Count": 1
}

Thanks Matt, that's perfect.  Maybe this could be mentioned on the CSV connector docs at https://voice.unifysolutions.net/knowledge-bases/7/articles/2869-csv-connector ?

Good point - will get the page edited when we update the documentation with SFTP information.