As the title says, I have a repeating section with a bunch of fields and sublabels. I want to use the sublabels to write the old value of that field. The rule sounds like this:
if new_value != old_value
set style of the new field, colour blue (which works absolutely fine)
set label of the new field as concat(Old value: old_value), true (so it's the sublabel).
Now here comes the problem.... whenever the set label rule runs, it sets the sublabel for all the fields in that repeating table.
I've already tried the "for i=0;i<count..." route and that doesn't work..
Any ideas or is this a dead end?
Here are some screenshots, in case I didn't explain it well.
Thank you! :)
You can try using ruleFieldInfo.rowIndices instead of running rule using a for loop (like : for i=0;i<count.)
ruleFieldInfo.rowIndices works only on the index where the field value is changed.
I have tried this with other rules in the repeating table, let me know if this helps, If not please attach a copy of test solution, I will give it a try if there's some other way to achieve it.
I was not aware of this expression.. could you please show me an example of how to use this in a js syntax?
I've found a way to use the ruleFieldInfo.rowIndices in my rules, but I think it's still not going to work. I've even tried running the rule in the F12 console, but the result is the same: It sets the label for all fields, even though I told it to do it only on the first row.
The JS route is one way to go.
I know rules on repeating sections or table scan sometimes be tricky.
How are you firing the rules for the sublabels? Rules at the row level should be triggered by something in that row - on change - not on load. Is that what you have? If not, is that something you can try?
Hope this helps.
Can you share a copy of the solution, or may be create a test solution with just the required field.
I will try to work it out if this is something we can achieve.
Sorry for not coming back to you on this matter.
I've decided to go the Repeating table route and ditch the labels.
Makes sense to mention that I am not running the most up to date version of Evolve, so this might have been fixed in the newer versions.
Sigrid: I've tried both with for and rowIndices and the result is the same. I've tried it both through rules and through the F12 console and it just doesnt' work as hoped, so I gave up for now.
Thank you all for your advice!