Hi,
I want to display the difference between today's date and created date in record type as an integer value. Further, I want to show the value in certain colors based on condition (like if the values is less than 3 then green color; if the values are in between 3 and 5 then yellow; and if the values are greater than 5 then red). This values will only come when the status is not completed.
Can somebody guide me?.
Many thank,
Discussion posts and replies are publicly visible
In Appian, you can just subtract the two date values and get a time interval in return.
Hi Stefan,
Thanks for your reply.
Is there any way I can achieve this?. I just wanted to show from how many days, a case has been opened (called it as "Days Open").
If not as a integer value, then I am okay with time interval. But how can I show the color on certain conditions (like only when the case is not completed).
Thank you
With "Days Open", do you mean calendar days or working days? There is the function networkdays that would return the working days.
https://docs.appian.com/suite/help/23.4/Function_Recipes.html#display-the-number-of-days-before-a-specific-date
You can turn an interval into the number of days using tointeger().
Then you can use a richtextdisplayfield and some conditions (if() or match()) to show/hide and color the values in any way you want/need to.
for color handling ->
a!localVariables( local!data: { a!map(id: 1, date: todate("1/02/2024")), a!map(id: 2, date: todate("1/12/2024")), a!map(id: 3, date: todate("1/17/2024")) }, { a!richTextDisplayField(labelPosition: "COLLAPSED", value: { a!forEach( items: local!data, expression: a!richTextItem( text: {concat(tointeger(today()-fv!item.date)," Days left"),char(10)}, color: if( tointeger(today()-fv!item.date)<=3, "POSITIVE", if( tointeger(today()-fv!item.date)<=15, "STANDARD", "NEGATIVE" ) ) )) }) } )
Hi Amaan,
Thank you for providing your insights.
I have modified the code little bit and now it is giving me the desired result.
a!localVariables( local!values: {if( tointeger(rf!riskAssessmentStatus.id)<5, tointeger(today()-rf!createdOn),"NA" )}, { a!forEach( items: local!values, expression: a!richTextItem( text: fv!item, color: if( fv!item = "NA","STANDARD", if( fv!item >= 6, "NEGATIVE", if( fv!item <= 3, "POSITIVE","#FFFF00" ) ) ) ) ) } )
glad to here that