Capture Appian Default Validation

Hi,

I have  a link to be disabled depending on the values entered by the user. (Link should be disabled in case of any validation error).

I'm able to achieve the same for user-defined validations and not for Appian default ones.

For example, I have a date field. A user-defined validation appears if the user enters any previous date. The link could be disabled in this case.

On the contrary, consider the scenario where the user enters a text value into the date field,

an Appian default validation occur(as seen above). Is there any possible way to capture this so that i can disable the link based on that condition? Or is there any way to automatically nullify/empty the value when the user enters a text value into the date field?

PS: Appian Version used - 17.4

Regards,

Vaisakh Sekhar

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If you'll look at the actual saved value coming from the date field, I believe you'll find in your screenshot example that when the user types text into the date field, for example - no actual data is passed into your local / rule input variable.  So in general we have no way of telling whether invalid data has been entered into a date field, however you should be able to design around the fact that the value will still be null in such a case.

  • Thanks Mike !!

    Yes, no data is passed into the rule input. 

    According to the requirement, the link should be disabled only when there is any validation error and not when the field is empty.

    Since a flag cannot be given for this scenario, I am back to square one. Anyway i will try again .

    Regards,

    Vaisakh Sekhar

  • I created a very basic test interface where you can set a local!variable as a Boolean, initialised to false, which controls whether the link is disabled or not; and in the Date field an a!save() that saves true to this variable if the value of the variable for the date field a value, and saves false if the value of the date variable is null. The effect is that the link is disabled and remains disabled until you enter a valid date.

    Here's the test:

    a!localVariables(
      local!isDateValid: false,
      {
        a!dateField(
          label: "My Date",
          value: ri!myDate,
          saveInto: {
            ri!myDate,
            a!save(
              local!isDateValid,
              fn!not(fn!isnull(ri!myDate))
          )
        }
      ),
        a!checkboxField(
          disabled: true,    
          label: "Is Date Valid?",
          choiceLabels: {"Yes","No"},
          choiceValues: {true, false},
          value: local!isDateValid
      )
      }
    )

  • Thanks Stewart!!

    Again, I wont be able to differentiate the scenarios 

    1. When the date field is empty

    2. When the date field is having an Appian default validation 

    as in both the cases, the local value remains false.

    The requirement for the link is that it should be disabled only when any validation error occur.(user defined or Appian default)

    The link should remain enabled when the field is empty.

    Regards,

    Vaisakh Sekhar

Reply
  • Thanks Stewart!!

    Again, I wont be able to differentiate the scenarios 

    1. When the date field is empty

    2. When the date field is having an Appian default validation 

    as in both the cases, the local value remains false.

    The requirement for the link is that it should be disabled only when any validation error occur.(user defined or Appian default)

    The link should remain enabled when the field is empty.

    Regards,

    Vaisakh Sekhar

Children
No Data