How to count nonblank lines in Repeated Grid?

25 views
Skip to first unread message

Władysław Czaja

unread,
Jun 22, 2020, 4:09:50 AM6/22/20
to Orbeon Forms

I'm just starting to get to know Orbeon Forms. I would like to count lines that are not filled in the Repeated Grid in In the Calculated Value control. I am using the count-non-empty function. While the formula works for me in Form Builder (test), when I click Publish it doesn't work and counts empty lines. I use the Orbeon Forms CE version

Władysław Czaja

unread,
Jun 22, 2020, 6:02:51 AM6/22/20
to Orbeon Forms
Here is my form: (if all - from x1 to x8 must be counted)

Alessandro Vernet

unread,
Jun 23, 2020, 12:44:57 AM6/23/20
to orb...@googlegroups.com
Hi Władysław,

What exactly constitutes a non-blank line? A line is non-blank if any of the
fields on that line is filled, or if they are all filled, or if a specific
one is filled? Or am I maybe misunderstanding what you're asking?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Władysław Czaja

unread,
Jun 23, 2020, 4:28:12 AM6/23/20
to Orbeon Forms
Hi Alessandro,

Thank you for the quick reply. In my case, I'm looking for a solution to count the lines where all are all filled. Of course, I am also interested in the case when a specific
one is filled, but this secondly

Even if I prepare a formula and it works in Form Builder (when I click the Test button), it does not work, if I want to publish (Publish button)

Besides, do you know any good tool for preparing xpath formulas? It seems to me that it is not easy to prepare formulas directly in Orbeon Forms, but maybe just because I think I'm just starting to get to know Orbeon Forms.

Vlad

Alessandro Vernet

unread,
Jul 1, 2020, 2:20:00 AM7/1/20
to orb...@googlegroups.com
Hi Vlad,

Got it; thank you for the additional details. So I think that an expression
as follows should do the trick:

count(//children-iteration[count(*[xxf:is-blank()]) = 0])

And here are some more details about how this works:
https://youtu.be/LWCy7APEQg0

You'll let me know if this works for you!

Alessandro Vernet

unread,
Jul 8, 2020, 12:51:31 PM7/8/20
to orb...@googlegroups.com
Hi Vlad,

Did you get a chance to work on your form where you wanted to count the
number of non-blank lines / iterations? If so, did the technique I was
describing in my previous message work for you?
Reply all
Reply to author
Forward
0 new messages