Automate

 View Only
  • 1.  Formatting and Message Rules Only Working for First Line of Repeating Table

    Posted 06-22-2021 15:34
    Hi,
    I am working on a section in my solution where a user can press a button to show data quality errors that may be present in their form.  The data/fields are in a repeating table.  I have two rules per field on the button.  One rule is an action message that will appear if the conditions are met and the second role is a formatting rule that will highlight the fields that are in violation.  I am finding that the rule only seems to be looking at the first row of data when determining if the conditions are met.   Is there something specific I need to do with repeating tables when applying rules to buttons?  I have other rules in my solution that set field values and it works fine for multiple lines in my table, but those rules are on the fields itself and not a button so perhaps this is the issue?

    Thank you and I appreciate all of your help and feedback!

    Krista Zinna

    ------------------------------
    Krista Zinna | Master Data Specialist
    Timken Company | 234-262-2008
    ------------------------------


  • 2.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Posted 06-23-2021 08:28
      |   view attached
    Hi Krista,
    If the rule is set up as a basic action rule, you will see results as you are, where only the 1st row of the table is evaluated. You will actually want a custom rule which can loop through the table. I have attached an example in case you haven't worked with this type of rule yet.

    ------------------------------
    Vanessa Kutasi | Application Analyst II
    IDEXX | New England WUG Leader
    ------------------------------

    Attachment(s)



  • 3.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Employee
    Posted 06-23-2021 10:29
    Hi Krista

    What kind of validation rules are you trying to apply?  And how are you trying to apply them? 

    It's usually best to apply them as the data is being entered, i.e. when it changes.  And for some, it's automatic - required, email data type will show bad formatting, if numeric and you enter alpha it will catch it, etc.

    I have rules in a repeating table, as well as the excel upload options, and I also turned on the enable validation results


    Since I am applying the rules as the values change, I enter data and/or upload data, it will show how many issues you have, if any, as well as what they are in a pop-up.  This is especially helpful when you have pagination on.

    validation pop-up - if I had multiple pages, it would give me a page number.  If I click on it, it would take me to that page




    You can also highlight errors by using a formatting rule.  Depending on when you want to highlight the field, you can specify run on load.
    The below example is if it's not blank, but you can use other conditions depending on what you're checking.


    Hope that gives you some ideas.  If you can share more specifics on what you're trying to do and when, and we may have other ideas.

    Best Regards,
    Sigrid

    PS:  Thanks, Vanessa, for jumping in to help as well!

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 4.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Posted 06-24-2021 09:30
    Thank you both for your response.  The rules that I would like to apply are data quality rules which typically compare fields within the rows against each other.   I don't really want to apply the rules as the fields change because if I have several columns in my table and I'm comparing a value in field A that I've just entered against a value in  field Z that I haven't yet entered (because it's a column that is later in the table) then the pop ups will be distracting and not necessarily valid (for instance a rule may say if Field A="test" then Field Z can't be blank).  If the rule applied when I populated Field A then it would say it was an error b/c Field Z has not yet been addressed.  I could apply the rule to Field Z but then I'm still at risk of the rules applying at the wrong time if the user choose to fill out the table differently.  It just seems to make more sense to evaluate the data with the rules once the rows are completely populated. 

    Vanessa - I appreciate your custom rule example but I'm totally new to Javascript and I think I would need to do more extensive research in order to create rules for all of the data quality rules I have. 

    The only other thing I thought of was to create a new helper field within my repeating content and place all of the rules on the helper field.  Then i can use an action rule on my button that will run the rules on the helper field within each row.  In theory it sounds like it may work but I need to test it out.

    ------------------------------
    Krista Zinna | Master Data Specialist
    Timken Company | 234-262-2008
    ------------------------------



  • 5.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Employee
    Posted 06-24-2021 09:36
    Hi Krista

    There are lots of ways to do workarounds, but I still believe applying them when entered is best.

    Can you place the rule on column Z instead of A?  And use if Z not blank AND A<Z (or whatever your comparison would be), so that it's not popping up when A is populated?

    Helper fields can be good things, but again, it's going to depend on what you're trying to do.

    HTH,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 6.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Employee
    Posted 06-25-2021 12:19
    Hi again Krista,
    I played around with a helper field and used formatting and validation rules on that helper field.  Here's what I get when i trigger it via a button
    first field required.  NumericField1 must be GE NumericField2
    -The validation messages end up on the helper field - a boolean, which IMHO is not great.  And it's only showing the last validation message, not all of them.
    -So I added formatting with a red background, but you don't quite know what the issue is.

    If I do this with rules, as the values are entered or uploaded from Excel, I see this

    - The errors are caught as they're entered.  In my view, that's good.  It should show you if you missed something.  Otherwise I enter everything, thinking it's all good, but then you run by a button and find it's all not.  I might have made the same entry on multiple rows, but if it was caught on row 1, I would have adjusted it and not made the same error on row 2.
    - This also shows the message right on the field without any rules of formatting.
    - And if you enable the validation on the table, you can use the pop-up I shared yesterday.

    My 2 cents.  Hope this is helpful information.

    Best Regards,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 7.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Posted 06-25-2021 13:12
    Hi Sigrid - thanks for your note.   I did try something similar yesterday and realized that only the last validation message ends up showing on the helper field, which is not ideal.  I'm back to working with keeping the rules on the fields however there is one thing that I'm struggling with that maybe you can help.  Most of my DQM Rules that I need to incorporate into my solution have several filters/factors.  The rule I'd like to use as an example is as follows:  If Plant = USN6 AND Sales Org = 0210 AND MRP Controller = KIT or C/A, then Item Category must = ZLUM.  I have two rules per field.  One is a validation rule that shows the error with the DQM Rule and the second is a formatting rule that turns the Item Category field Red.   You can see below an example for material b where the condition is met and the field turns red, the validation message appears. 

    In this case if I change Item Category to ZLUM, then the formatting clears and the message disappears.  Let's say the Plant was actually incorrect though, and the user fixes it.  The conditions are no longer met and since the formatting rule that I have on Plant allows me to specify which field the formatting is applied to, the formatting on Item Category disappears since Plant changed.  The validation rule on Item Category is not cleared b/c that field was not changed.   


    I understand the logic and why the rules are working this way.  I can tell my users to disregard the rule as long as the formatting is cleared, but this can get confusing.  I could also try to infer which field would most likely be the field to be changed (in this case the Plant will probably NOT be incorrect and the user would just fix the item category) and only apply the validation rule to that field.   But neither option is good.  This is another reason I thought that having all the data filled out first and then applying the rules would make the most sense.  

    Any additional insight would be appreciated!
    Krista

    ------------------------------
    Krista Zinna | Master Data Specialist
    Timken Company | 234-262-2008
    ------------------------------



  • 8.  RE: Formatting and Message Rules Only Working for First Line of Repeating Table

    Employee
    Posted 06-25-2021 13:26
    Hi Krista

    Only have time for a quick suggestion - based on a  quick look, I would use cascading dropdowns.  

    I'd create a table with valid combinations - SQL table, SP list or Reference data list - and then only enable/allow the item category to be selected once the dependent fields have been filled in, like plant, sales org, mrp controller.   When plant or sales org or mrp controller is changed, I would clear the item category, and make them pick the correct value.

    Hope that gives you an idea,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------