Notes on using DataGrab to import into Matrix fields.

Playa, Matrix, and any Pixel & Tonic fieldtypes are deprecated. If you have a site with an import configured to use them, DataGrab may continue to work, but no future development will be performed on those fieldtypes, and support will not be provided for them if there is an issue importing values into those fields. Playa and Matrix are antiquated and should be switched to Relationship and Grid fields respectively. The specific files no longer supported are:

  • datagrab_matrix.php

  • datagrab_playa.php

  • datagrab_fieldpack_checkboxes.php

  • datagrab_pt_multiselect.php

Configuring the import

The results

Matrix cell types

The beta version currently supports text, date and file cells. Support for other cell types to follow.

Date fields can be formatted in any recognisable date format (YYYY-MM-DD HH:MM:SS is recommended)

Images/files should be uploaded manually to an existing File Upload area and the filename in the data source should be prefixed with the Upload area variable (e.g., if filename.png is in the upload area with the id of 1)

Supported data types

CSV and XML imports are supported. I’ll document these better as the beta progresses. Feel free to contact me in the meantime if you need help.

Example data format are:


		<description>Lorem ipsum dolor sit amet…</description>

ie, repeating item elements can be imported into a Matrix. Select the first item in the configuration pulldown, and DataGrab will add the rest

CSV with Matrix rows on separate lines of the file

ID1,"PRODUCT1","Blah, blah, blah.",A1,"OneA","","","2011-12-11",12.99
ID1,"PRODUCT1","Blah, blah, blah.",A2,"OneB","","","2011-12-11",13.99
ID1,"PRODUCT1","Blah, blah, blah.",A3,"OneC","","","2011-12-11",14.99

In the settings assign a unique id (eg, product id) to a custom field. Use that field to check for duplicates and check the Update existing entries setting.

CSV with matrix rows as comma delimited values in a cell

E;"PRODUCT5";"Blah, blah, blah.";"E1,E2";"ThreeA,ThreeB";",";"2011-11-04,2010-11-16"

Note, that the 4th to 7th columns each have 2 comma-separated values. Each value will be assigned to a new matrix row.

Last updated