hello,
I'm new with Appian. Im trying to build a test application to showcase to some people. I'm at the beginning stages and currently building an Interface. I made a simple form where you fill in your birth date. Now I want another drop down component to appear only when the age of the person is equal or greater than 67. I created taht component and checked the "only show when" function. Now I'm trying to come up with the condition I need to fill in but can't figure it out.
I currently have something like this:
tointeger(today() - ri!BirthDate) >= ?
Can someone help me out?
Discussion posts and replies are publicly visible
Hi,
You can use the edate() function to return a date that is a certain number of months before/after the starting date. Your function could look something like the following:
edate(today(), -804) >= ri!BirthDate
You can read more about this function at https://docs.appian.com/suite/help/17.2/fnc_date_and_time_edate.html
Thanks,
Lucas
You could create an expression rule that tests whether a certain date is greater than a certain number of years in the past - or just plug the code in where you need it if you just need it once. The code I came up with that should take care of your use case is: ri!birthdate <= date( year(now()) - ri!age, month(now()), day(now()) )
So there's one more thing. I use this expression for two drop down lists. One when age equals or greater than 67 which is the expression you gave me, and one for when age is less than 67 which is edate(today(), -804) < ri!BirthDate. They both work. But for some reason the drop down list for >=67 is also visible when ri!BirthDate value is null. It needs to be only visible when value is not null. I tried different things but it can't seem to accept null as parameter because value is date format. Any suggestions?