Gruber
Total posts: 5
26 Jul 2015 00:45

Hello there,
as title goes I'd like to know how to import as records a bunch of rows in cobalt from a spreadsheet file (be it csv, xls, ecc..).
I read in your feature page that it's possible from the frontend but I can't find a way to do so and haven't found anything on it in your docs section. Am I missing something blatantly?

I would like to take this opportunity to thank you and compliment for this incredible piece of work, I've been working with joomla for quite few years, but only now I've finally found the holy grail of CCK! :)

Last Modified: 28 Jul 2015


pepperstreet VIP
Total posts: 3,837
26 Jul 2015 01:31

Welcome to the world of Cobalt!

Hello Gruber, (BTW nice nickname and avatar ;) )

you are on the right track, the import is a frontend feature. You have to create a respective J! MenuItem type.

1.) Create new MenuItem - Select type ...

mj_cob_menuitem_new

2.) Choose Cobalt MenuItem types ...

mj_cob_menuitem_types

3.) Scroll down and choose Import

mj_cob_menuitem_import

Remember to restrict access to this frontend menuItem!


GCDG VIP
Total posts: 9
26 Jul 2015 14:45

I'm not alone who can't find this. :)


Gruber
Total posts: 5
26 Jul 2015 15:29

Hehe Yippee ki-yay erm... Thank you Pepperstreet!

As I thought I missed badly a quite obvious spot to look at (glad I'm not the only one! ;) ).

If I can ask more in this thread, I can't seem to grasp the way it works:
I've set up a testing type and section with a bunch of fields (all simple text fields), and used a .csv file I've found googling around (more precisely the real estate one from this page.

Went to the next step and there I got stuck. I picked "new import settings" and I saw the right column populated with the fields I created for the type I selected in the Import menu option. Still all the items on the page show only a "Do not import anything here" option. I guess it has something to do with the "ID" form field, but just like the others I can't choose anything but the above mentioned option. The .csv I uploaded uses commas as required so I guess I'm missing again something (hopefully this time not so basic x) ).
Thank you again for your time and support (even on sunday!!) :)


pepperstreet VIP
Total posts: 3,837
27 Jul 2015 03:28

Gruber Still all the items on the page show only a "Do not import anything here" option

Hello again, just made a quick test with the same file. I could not see any CSV field names in "Associate Fields" selectboxes either...
Maybe something is wrong/incompatible with the line endings or the encoding!?

Tip: I had to open the file in a Spreadsheet Application (e.g. Apple's Numbers) and had to export the file again. This time, the CSV file was recognized and the field names showed-up.

However, you would also have to select values for the required options marked with an * !


BTW, as far as I know you could import the long/lat geo-data into a respective Cobalt Address & Map field. Only this field type allows a Google Map view, distance search etc.


Gruber
Total posts: 5
27 Jul 2015 05:57

Thank you for your answer! Ok opening and resaving it from excel 2010 in .csv file (MS DOS) did the trick as you said, but I'm still facing some issues: the Import window simply throw every row in all the field, look the image below

import test csv cobalt

Unfortunately I can't really tell what is going on, I've double checked the import option to be set to Semicolon(;) but still no difference. What am I doing wrong? I chosed this file simply because among the other was one with the smallest set of records, not really interested in the type. Am I doing something wrong in the field settings maybe? I've simply created them as text fields, should I look for something else in the configuration of the Type or Section maybe?

Thanks a lot again for your help!


pepperstreet VIP
Total posts: 3,837
27 Jul 2015 16:47

Hello Gruber, I have seen this behavior in the early days of the importer. In the beginning it worked with "COMMA" seperated files only. AFAIK, this has been fixed a long time ago... maybe not!? ;)

Actually, it should be an issue with the exported file and format.
Did you try to export it with COMMA?


Regarding the Cobalt field type:
As always... it depends. If you just need the info in plain text format, you may choose the "Text" field for the whole data. I just assumed you are after the Address data, and want to make it more usable.


Gruber
Total posts: 5
27 Jul 2015 20:33

Aha! There you go!
All is working properly now and as expected the Comma delimitation worked perfectly!

Stupid question, what is exactly the ID field used for? I understand it has to do something with the very handy update feature, but is there any criteria I should keep in mind when selecting a column for it?

Thanks a lot for your help! If I can spare some time I will create a simple page for the doc section for others to come!


pepperstreet VIP
Total posts: 3,837
27 Jul 2015 21:30

Gruber Stupid question, what is exactly the ID field used for? I understand it has to do something with the very handy update feature,

Funnily enough, I did not make use of it, yet. Although I made a zillian demo installations and tests :)

but is there any criteria I should keep in mind when selecting a column for it?

It should be a unique value. AFAIK, it is not required to have an "ID number" in the usual sense. As you mentioned before, it is a value that identifies each record. No other record has this value, so another import is able to find and update that exact same record. Otherwise, a new record is created.

Alternatively, you might create an extra column and data to serve as an "ID".


Gruber
Total posts: 5
28 Jul 2015 15:23

Great!
As a small contribution I made a simple guide for the Import feature of cobalt, you can find it in the pull reques on Github.

Modify, change or trash it at your discretion!

Care tho that the urls of the images I linked in the guide page are from this thread and one is hosted on imgur, I think it's better to upload them to a proper position somewhere else.

Thank you again for your time and support! :)


pepperstreet VIP
Total posts: 3,837
28 Jul 2015 16:54

Gruber As a small contribution I made a simple guide for the Import feature of cobalt, you can find it in the pull reques on Github.

Really nice!
Even better to contribute directly to the documentation area.
Here is a How-To video on youtube.

Thanks in advance!

Powered by Cobalt