Automate

 View Only
  • 1.  Control labes per section in a repeating section

    Posted 09-28-2023 03:43

    Hello everyone!

    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! :)



    ------------------------------
    Florin Dumitrescu
    Carestream Dental LLC
    Atlanta GA
    ------------------------------


  • 2.  RE: Control labes per section in a repeating section

    Employee
    Posted 09-28-2023 16:43

    Hi Florin,

    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.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Control labes per section in a repeating section

    Posted 09-29-2023 03:36

    Hello Hammad, 

    I was not aware of this expression.. could you please show me an example of how to use this in a js syntax? 

    Thank you!



    ------------------------------
    Florin Dumitrescu
    Carestream Dental LLC
    Atlanta GA
    ------------------------------



  • 4.  RE: Control labes per section in a repeating section

    Posted 09-29-2023 04:00

    Hello Hammad, 

    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.

    Thanks!



    ------------------------------
    Florin Dumitrescu
    Carestream Dental LLC
    Atlanta GA
    ------------------------------



  • 5.  RE: Control labes per section in a repeating section

    Employee
    Posted 09-29-2023 19:53

    Hi Florin

    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.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 6.  RE: Control labes per section in a repeating section

    Employee
    Posted 09-30-2023 16:27

    Hi Florin,

    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.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 7.  RE: Control labes per section in a repeating section

    Posted 10-10-2023 10:09

    Hello everyone, 

    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! 



    ------------------------------
    Florin Dumitrescu
    Carestream Dental LLC
    Atlanta GA
    ------------------------------