Repeating lists and tables

i would like to make a table with 3 columns, where the first one indicates the contenance and the two next columns are the information that needs to be filled in.

I want to make it more difficult and make a snippet in those columns that refers to many conditions and that are based on repeating lists.

But then I get: ‘multiple repeating lists in one row’ as a remark. Can I solve this a certain way?

fyi #1220267 is my clause

Hi Sarah,

As the error message suggests, you are using multiple repeating datafields in the same table row, and this is not allowed.

The underlying reason is that, as soon as you use a repeating datafield in a table row, the software will repeat that row as many times as there are values present in that datafield. (For example, if the repeating datafield has fixed type “text”, and it contains values “alpha”, “beta”, and “gamma”, the software would repeat that table row three times — whereby the repeating datafield will get the value “alpha” in the first row, “beta” in the second row, and “gamma” in the third.)

Following this methodology, it obviously becomes ambiguous for the software to know how many times to repeat a particular table row when you insert multiple datafields in it — as you did in your clause. Hence the error message.

My primary recommendation would be to convert the repeating fields in question into “normal” (non-repeating) fields.

If that would not be possible, you can force-convert the repeating datafield into a regular datafield (by using an underscore before the datafield) and extracting the value from a particular position in the datafield. For example, @get(#concept^_datafield, 1) would extract the first value of the datafield. If you use such a construction, the table row will no longer get automatically repeated.

owkey!! thx!!

I was running into the same issue and found this thread.

I tried using this, but ran into an error:
image

Has this behaviour been changed?

After a bit of testing, it seems both @get and @nth don’t work in tables:

Instead of displaying the item I want to @get, the rows are repeated x times for the amount of entries in the repeating-list datafield.

Is there a way to include data from a repeating-list datafield within a table without the table rows getting repeated?

I am also unclear what the “Not a collection” error means here.

Thanks!
Kai

When you use a repeating list datafield inside a table, Clause9 will assume that that table row will have to be repeated for each element that is entered into the datafield, similar to how a repeating clause would repeat. Each (repeating) row will therefore handle the respective element not as part of a list, but as a single element similar to another normal datafield, e.g. in a repeating text datafield that repeating row will contain just one text value. This explains the “not a collection” error: Clause9 just finds a single element inside a repeating row, which is an invalid input (because it is not a list) in the @get special function.

Now if you (i) are in a repeating context (e.g. a table row or a repeating clause) and (ii) want to force Clause9 to look at the entire list of a repeating list datafield, you will need to force Clause9 to “escape” the repeating character of the repeating list datafield. This is done by using an underscore as such: #concept^_datafield (as opposed to #concept^datafield).

Including this datafield will make Clause9 handle this specific reference to the datafield as a list at all times. And it therefore can be used in special functions like @get and @nth.

Because this underscore is not included in the clause you copy/pasted above, you are getting the errors shown in the screenshot.

The full explanation can be found here: Repeating list datafields – Help.

@robbert.jacobs thanks a lot for the explanation. I assumed that the _underscore in Maartens example above had no significance. This is really useful!

Cheers
Kai