Problems, need help? Have a tip or advice? Post it here.
11 posts Page 1 of 2
Hello,
I know I have asked this question last year, but in one of my project, I absolutely need to make this work.
I must stay with Couchcms, and import like a thousand entries from a CSV file, and I must be able to import stuff that will go in repeatable regions.

How can I make this work?
I have no idea. From what I remember, KK told me it was not possible in the state of Couchcms last year. Maybe there's something new this year?
If needed, I can pay to get an updated version of the CSV importer that would handle repeatable regions.

Thanks a lot
Hi,

With Couch v2.1, it is now possible to set repeatable-regions through <cms:db_persist /> -
viewtopic.php?f=8&t=11400

Which means that we should now be able to use the CSV importer to input data into repeatable-regions.
It would require converting the data to be inputted first into valid JSON format, as explained in the mentioned post.
Thanks KK.

That's what I was thinking too. But how can I setup a CSV file with multiple rows of a single repeatable region?

For example, if I need to import an entry from a CSV file with 3 rows, containing 1 text field each, I'm not sure how the structure of the CSV file should look like.

For example, if my code looks like this:

Code: Select all
    <cms:repeatable name='block_book' label="Book block">
          <cms:editable name='subject' label="Subject of the book" type='text' />
          <cms:editable name='img' label="Image of the book" type='image' />
    </cms:repeatable>


What happens if I must import an entry with 2 rows of that "block_book" region?
How the CSV file would need to be formatted?
Anybody knows how to handle this?
Sorry to bump, it's just that one of the biggest project I've made yet with Couch is almost done, but I need to fix some issues before handling the files to my client, and that's one of the issue. I need to send the data this week.

Thanks a lot for understanding, and thanks for you help
I was under the impression that you already have a CSV file available.
Is that not so?

Where exactly is the data to import right now?
Sorry if it wasn't clear KK.

I have a file with data, for all "non-repeatable" regions, but I just don't understand how to set it up for the repeatable regions part.

Since a repeatable region can have 3 rows for example, how is that supposed to be displayed in a CSV file?
So that I can import a CSV, and that Couch will understand that there's multiple row to 1 repeatable region.

Thank you very much!
Question is - how do *you* know taking a look at the current data how many rows of repeatable regions will a particular row of CSV take?

One CSV row, perhaps will take 3 repeatable-region rows and another might take 7.
Or is it that all rows will take a fixed number of RR rows?

Please post some sample rows from the CSV explaining the logic.
Oh gotcha.

I'm about to import data from another system. Another web app.
The company that have worked on that web app can generate a CSV file for me, mapping the columns titles to what I need.
They're not using Couchcms. It's a custom built web app.

The thing here, is that on the current web app, there's a region with 3 "dates" possibilities for events.
It's an old web app, and back in the days, the fields were like that :

Event 1 name :
Event 1 location :
Event 1 date :
---
Event 2 name :
Event 2 location :
Event 2 date :
---
Event 3 name :
Event 3 location :
Event 3 date :


These are all text fields. It was made that way because sometimes, the users needed more than 1 event in the same entry. But most of the time, it was only 1.

So what I did, for the new version of that web app using Couch, is making 1 repeatable region, with the "name, location and date" fields. Since it's a repeatable region, the user can now add rows if needed instead of having 3 blocks of text fields that may or may not be used. Looks a lot cleaner with repeatable regions.

So in the CSV that will be handed to me, it's probably going to look like ("|" pipe character being cells delimitations) :

event1_name | event1_location | event1_date | event2_name | event2_location | event2_date | event3_name | event3_location | event3_date

But since now it's a repeatable region in Couch, how can I compress all this to fit inside 3 rows of the repeatable region?
The other programmers can condense data inside the same field if needed. Like putting all events name in 1 field, all locations in 1, and all dates in 1. If needed.

Hopefully it's a bit clearer now.
Thanks a lot!
Thanks. Yes, it is a lot clearer now.
If you can get a data dump from the previous app, please PM me a part of it containing several rows (real world data with *all* fields).

Thanks.
Thanks KK. I just did.
I also sent you the names of the columns where it's going to be data that needs to go in the repeatable region block.

Thanks again
11 posts Page 1 of 2