Integer in one screen, text in another sceen

Let me start by saying that our OutSystems version is at 11 and this is a mobile application.

In the first screen you choose where the picture will be taken (Werkplaats, Inkomende goederen, Uitgaande goederen or Kwaliteits Management). The value of the four buttons is 1, 2, 3 or 4. The value of the buttons is passed through a SOAP web service and it need to be a integer value there.


In one of the following screens I want to show not the integer value but the textual value, but at this point I have no clue on how to do that. Is there anyone that could help me a bit with that?



Hi Bart,

In above, if values are fix to four (or any number) then I will suggest, create one static entity and in that entity define those values. After doing so you can show the label of static entity record easily.

Thanks.

If you don't want to use static entities then in second screen expression you have to write if conditions for this. Below is example if(SelectedType=1,"WerkPlaats","Inko..")

Vikas Sharma wrote:

Hi Bart,

In above, if values are fix to four (or any number) then I will suggest, create one static entity and in that entity define those values. After doing so you can show the label of static entity record easily.

Thanks.

Hi Vikas,


Thanks for you answer. I did create a static entity with the four options. I am still not sure how to continue from this point. I stil have the local variable with the integer value and I am not sure on how to connect this to the static entity I just created.



Hi Bart, 


There are multiple option to do this. 

1. If there are only 4 static button then you can check button value in your second screen expression with IF clause.  

2. As suggest by Vikas, you can use static table for this. 

Vikas Sharma wrote:

If you don't want to use static entities then in second screen expression you have to write if conditions for this. Below is example if(SelectedType=1,"WerkPlaats","Inko..")

I am not sure how to continu this IF statement because the one you posted will do the following:

If SelectedType = 1 it will be "Werkplaats" all other options will result in "Inkomende goederen". How can I do multiple options within the IF statement? And for development purpose, which of the options you suggested is the better way?


Hi Bart,

As you mentioned your local variable is of type Integer. So you can assign selected static entity record Id to that variable. 

you can do like this : localVariable = Entities.<StaticEntity>.<Identifier>

Here StaticEntity = Type(static entity name as you mentioned)

Identifier = Id

like in your case it will be like

localVariable = Entities.Type.Werkplaats.Id


Thanks.

Solution

Bart Nooijens wrote:

Vikas Sharma wrote:

If you don't want to use static entities then in second screen expression you have to write if conditions for this. Below is example if(SelectedType=1,"WerkPlaats","Inko..")

I am not sure how to continu this IF statement because the one you posted will do the following:

If SelectedType = 1 it will be "Werkplaats" all other options will result in "Inkomende goederen". How can I do multiple options within the IF statement? And for development purpose, which of the options you suggested is the better way?



For solving this using If condition, you need to use multiple If conditions like this.

SyntaxEditor Code Snippet

If(Variable=1,"one",If(Variable=2,"two",If(Variable=3,"Three","four")))
Solution

Vikas Sharma wrote:

Hi Bart,

As you mentioned your local variable is of type Integer. So you can assign selected static entity record Id to that variable. 

you can do like this : localVariable = Entities.<StaticEntity>.<Identifier>

Here StaticEntity = Type(static entity name as you mentioned)

Identifier = Id

like in your case it will be like

localVariable = Entities.Type.Werkplaats.Id


Thanks.

I almost get what you are saying except for the Id part. How do I select that one?


Hi 

I missed you need to use like this "Entities.Type.Werkplaats". No need of Id here.

Thanks.

Vikas Sharma wrote:

Hi 

I missed you need to use like this "Entities.Type.Werkplaats"

Hi Vikas, 


I got your If statement solution and it is working :). Thanks for that!


But still I would like to learn what I am doing wrong with the static entity part. I guess the error message is correct because the local variable expects an integer value and I am not giving that.