1

Topic: CSV import format for data with multi-value occurrence attributes

Hi,

I regularly import observation data from CSV files using a Utilities > Importer page. I have a new survey now which has a multi-value Occurrence Attribute (Annual cycle) with 4 possiblities (Bare, Leaves, Flowers, Fruits) from a Term list lookup. There can be one or more options selected so the "Allow multiple values" option is ticked. From a data entry form on the website everything works correctly.

The problem I am having is getting the syntax right to import from a CSV file. If the Annual cycle field contains one value such as Flowers the import works but how should I structure it if there are multiple values? I've tried a variety of things with the names and term IDs e.g. "Flowers,Fruits", "Flowers|Fruits", "379,378" and "{Flowers,Fruits}" but I always get an error like "occAttr:137: Invalid value 'Flowers,Leaves' for attribute Annual cycle".

For example, the first line of this file import; the others don't:

Date,Occurrence created by,Sample created by,Grid ref or other spatial reference,Species or taxon name,Annual cycle
05/09/2022,Chris_Brown,Chris_Brown,22.686461S 17.116769E,Tarchonanthus camphoratus,Flowers
05/09/2022,Chris_Brown,Chris_Brown,22.686183S 17.117124E,Tarchonanthus camphoratus,"Flowers,Fruits"
05/09/2022,Chris_Brown,Chris_Brown,22.686183S 17.117124E,Tarchonanthus camphoratus,"{Flowers,Fruits}"
05/09/2022,Chris_Brown,Chris_Brown,22.686183S 17.117124E,Tarchonanthus camphoratus,"378,379"
05/09/2022,Chris_Brown,Chris_Brown,22.686183S 17.117124E,Tarchonanthus camphoratus,"{378,379}"

Can anyone please help?

2

Re: CSV import format for data with multi-value occurrence attributes

Hi Alice
Unfortunately I don't think the default import code actually supports multiple attribute values at this point in time - I've always handled this by writing custom import scripts as part of a bigger, more complex import.
John

John van Breda
Biodiverse IT

3

Re: CSV import format for data with multi-value occurrence attributes

Okay, thanks for the reply. Plan B then...