Hi,
I have a RichTextDisplayField within which I have a RichTextIcon which has to be executed in loop and I want the icon should be printed only once on updated with last item in the loop.
a!richTextDisplayField( label: "Sample", labelPosition: "COLLAPSED", value: a!localVariables( local!reconds: rule!Record_Rule(), local!time : fv!item.Time, a!forEach( items: local!reconds, expression: a!richTextIcon( icon: "times", caption: fv!item.type & if(not(rule!APN_isEmpty(fv!item.comment)), " : " & fv!item.comment,""), showWhen: and( totime(tostring(text(fv!item.starttime,"hh:mm aa"))) <= totime(local!time), totime(tostring(text(fv!item.endtime,"hh:mm aa"))) >= totime(local!time) ), color: if( fv!item.type = "Busy", "#800000", if( fv!item.type = "Occupied", "#3DD80B", if( fv!item.type = "Off", "#0000FF", "#000000" ) ) ), size: "STANDARD" ) ) ), align: "CENTER" )
Current display :
Expected Display :
Please help me on this
Discussion posts and replies are publicly visible
The first thing I would do to debug is :
a!forEach(
items: local!reconds,
expresson: fv!item
)
The results of that kind of construction have been deeply illuminating to me countless times. That's how I start practically all a!forEach.
Can you suggest me any alternative solution to achieve this ?