Hello all, I was wondering if there's a way for a list table record to change a local variable as it's listing each record. For example, I have a table with one attribute that's a number (1-12). I was wondering if I could create an expression that would change what it outputs depending on the number, i.e. if(num = 1, "One") else if(num = 2, "Two) etc. 


Is there something like this that exists or do I just have to change the physical table?


Edit: As I have it now, here's my expression for the attribute, 

If(HrPtoRequest.PTOR_MONTH_NUM = 1, "Jan", If(HrPtoRequest.PTOR_MONTH_NUM = 2, "Feb", If(HrPtoRequest.PTOR_MONTH_NUM = 3, "Mar"

etc. It changes per row as it needs to when I preview the data, but when I want to grab it and list it in a table record, I use 

GetHrPtoRequests.List.Current.MONTH_STRING

But it just outputs the string for the first row, it doesn't update per row like I need it to. 

The if statement takes place during preparation btw

Solution

G. Andrew Duthie wrote:

Is there a reason you can't use the Switch statement from the toolbox?


https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Web_Logic_Tools/Switch


When I tried using this in the Preparation action, and I used twelve different assign statements for a local variable, I ran into the same issue where it just stuck with the first, but I got it figured out by just formatting the output with Formate_DateTime

Thanks tho!

Solution