Expressions - show only first entry of a repeatable group

Hi,

I am trying to use an expression to show only the first entry of a repeatable group field. I have the following repeatable group with one simple text field inside:
image

Now, within a text cell in the form, I want to show the first entry of the repeatable group (if there is one).
With the following expression I am showing a comma-separated list of all added entries.

kontext(root) {
	kontext(BegehungDurchgefuehrtMitGroup) {
		[BegehungDurchgefuhrtMit] ", "
	}
}

But how could I just display the first one? (i.e. accessing [0] of the items)

This feature does not exists in expressions at the moment.

However, it should be possible to use computations with expression to achieve this behavior. Copy with computations the necessary fields into a non-repeatable group and show them with the expression. You should also mark the fields in the non-repeatable group as transient.

Thank you for the answer.

immagine

I started with creating a field to output the value of the calculation (FirstBegehungDurchgefuehrtMit) and the calculation itself (FirstBegehungDurchgefuehrtMitComputation).

But I am stuck trying to get the GroupFilled correctly. I don’t know if it is the correct way to check if the group has at least 1 repetition!? (can’t find any info in the docs…)
And also in the computation itself I wouldn’t know how to access an index of a repeatable group…

Could you give us some more help?

You want to use AtLeastOneGroupFilled(repeat*)

Thank you, and how can I access index 0 of a repeatable group within the calculation?

I think you wanna use FirstFilledValue

image