Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

We sometimes get the request to support repetitions in a text item and although we do think this is a feature we would like to implement, we have not gotten round to it yet as there is in most cases a (not very user friendly) workaround. To explain this we use the example of a set of persons:

Instance IDPerson.namePerson.age
Person1"Kim"25
Person2"Rick"30
Person3"Bob"35
Person4"Bob36

 

Simple cases

For this workaround we use the possibility to add fields to a text item in which we can model collects to give us a set of values which we can join into a presentable string. This would look similar to:

...

In this example we collect the names of all persons and add the instance ID to the string between two identifiable characters. In the example we used the standard comment characters used in Blueriq, but this could be any identifiable character sets. In the replace function we use a simple regular expression to search for these characters and replace these and everything in between with a an empty string ("" at the end). 

In the case described above where you have the collection of instances with names: Kim, Rick, Bob and Bobour case, this will result in the string:

No Format
nopaneltrue
"Kim, Rick, Bob, Bob"

...

Static text repeat

In a variation on this, we could also repeat static text. where this:

Code Block
COLLECT "TEST" FROM ALL Person

Would result in the our case we described earlier result in the string:

No Format
nopaneltrue
"TEST"

. As there is only one unique element in the collection.

...

Code Block
REPLACE( "/*.+?*/" , JOIN( COLLECT "TEST" + "/*" + Person + "*/" FROM ALL Person ,", "),"")

Which would result in:

No Format
nopaneltrue
"TEST, TEST, TEST, TEST"

 .

 

UI Expand
titleRelated articles

Content by Label
showLabelsfalse
max5
spacesBKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("repeat","textitem") and type = "page" and space = "BKB"
labelstextitem repeat