Page History
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 ID | Person.name | Person.age |
---|---|---|
Person1 | "Kim" | 25 |
Person2 | "Rick" | 30 |
Person3 | "Bob" | 35 |
Person4 | "Bob | 36 |
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 | ||
---|---|---|
| ||
"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 | ||
---|---|---|
| ||
"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 | ||
---|---|---|
| ||
"TEST, TEST, TEST, TEST" |
.
UI Expand | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
|