Automatically create data records


#1

Matrix Version: 5.4.1

Is there an easy way to create Data records automatically ?

I have a situation, where we have a list of hundreds of events, which we want to display on a page. They can be searched by a keyword and/or filterable by a category. I have a CSV file for all events.

I don’t want to use CSV data source, because the CSV files are often updated by different editors and data entered is not sanitized and doesn’t always follow same structure. For example, different people can enter time as 3pm or 3:00 pm or 03.00 pm or 15:00. There are many other fields with similar issues. This causes lots of issues with the code.

So, I want to automatically create “Data-records” from a cleaned CSV file once, apply a metadata schema, and give editors some pre-selected options using drop-downs / radio-buttons etc to choose from, so as to eliminate the problem of dirty data.

I am thinking about using JSAPI for this, but is there any less “coding intensive” option out there ?

Any ideas/thoughts are highly appreciated.

Thanks in advance.


(Nick Papadatos) #2

We did something similar where we had hundreds of events but we didn’t want to use a CSV data source for the same reasons you posed.

That said, we created a csv data source uploaded the cleaned CSV file with the proper time format etc.

We then created an asset listing page and applied a XML design file- used the export tool (all of the dependant files) then reconfigured the xml structure to create a data records instead with the right metadata applied etc.

We then used the import xml tool and that should build all your data records. When complete you can update any of the data records accordingly via metadata.

Does that sound doable?

N


#3

Hi @NickyP That looks like a clever solution. I will give it a try, though our Import/Export tool never worked properly. Thanks for your help.


(Nick Papadatos) #4

Not a problem, another hint is to only add one row of data in your CSV then export making it easier to hack the XML - when you’re ready upload the full CSV data then rerun the import/export XML

cheers
N