Good morning I have a recordtype field that has values 1,2 and 3. I am trying to have the field value to be displayed as 1 = Draft, 2 = In Progress and 3 = Finalized. can any assist me with this?
Discussion posts and replies are publicly visible
This seems to be some king of a status. I typically store literals to the database which would make my values being DRAFT, IN_PROGRESS and FINALIZED. Then I use an expression rule and the proper() function to display these.
In your case, a simple decision table might be the most low-code'ish approach. But there are more options, so let's see what the others think.
In the database the values are 1, 2 and 3. I want Draft to populate on the screen instead of 1 and In Progress instead of 2 and the same for Finalized
I have tried the If( and = expression but I don't know if I type it in right.
I do not know where you type this, but a decision table would look like this:
when you have an issue with a code snippet, it is a good idea to post the whole snippet and use
here is the expression
a!columnLayout( contents: { a!richTextDisplayField( label: "Status:", labelPosition: "ADJACENT", value: { a!richTextItem( text: fv!item ['recordType!], color: local!textcolor ) }, align: "LEFT", marginAbove: "NONE", marginBelow: "NONE" ) } )
TByrd5009 said:fv!item ['recordType!]
... does not seem like proper syntax in any sense, unless this is part of a far bigger pattern and you're leaving stuff out here.
Please consider posting a screenshot of your wider context and/or more of your interface code, though as Stefan indicated, please use a Code Box (he even showed you how in his embedded screenshot). Even the small snippet you posted here is multiple times harder to read since it's unindented and unformatted, and longer code is exponentially worse-off.
displayvalue(1, {1,2,3}, {"Draft","In Progress", "Finalized"},null)