validate hours and minutes

Hello,

I'm validating two fields:
the first field is the hours and the second the minutes.


I need the hours to be greater than or equal to 9 and the minutes less than or equal to 59

validations: {
if(
and(
local!hours >=9,
or(between(local!minute<>0,local!minute>59)),
"The values ​​in this field must be between 0 and 59"
),
"The effective hours can not be more than 9",
{}
)
}

thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Firstly, I don't think we have any between() function available in Appian. And for the validations,you can add field validations in respective fields. Like in hours,

    a!integerField(
    
    label:"Hour",
    
    validations:{if (local!hours>9,"Message","")})

    Similarly add validations in minute field like 

    a!integerField(
    
    label:"Minutes",
    
    validations:{if (and(local!minutes>0,local!minutes<59),"","Message")})

    Hope this helps.

Reply
  • 0
    Certified Lead Developer

    Firstly, I don't think we have any between() function available in Appian. And for the validations,you can add field validations in respective fields. Like in hours,

    a!integerField(
    
    label:"Hour",
    
    validations:{if (local!hours>9,"Message","")})

    Similarly add validations in minute field like 

    a!integerField(
    
    label:"Minutes",
    
    validations:{if (and(local!minutes>0,local!minutes<59),"","Message")})

    Hope this helps.

Children
No Data