316
Views
15
Comments
Assign Local varible value in If Condotion
Application Type
Reactive

Hi All,

I want to assign Local varible value when if Condition true like This


is It Possible ???


Thanks

2022-04-29 09-08-10
Pramod Torase

hello,

you can do like this

UserImage.jpg
Md Mansur

I have a expression and in this expression I have if condition ( If condition is true than Assign value in local variable 

UserImage.jpg
Md Mansur

My req is   I have a expression and two local variable 

1. date

2. position

In expression First Check If Condition(Date = CurrDate())  if condition is false simple print a text and if condition is true than 

print a text and also assign a value to local variable like Position .

Is it Possible???

2022-04-29 09-08-10
Pramod Torase

Instead of using expression you can use IF and insert that condition date=currdate().

On true side assign position=1 and the text variable you are using to print text with the text you want to print.

and on false side you can assign just a text variable with the text u want to print.

UserImage.jpg
Md Mansur

Ok But How to assign Local Varible Value in true Condidition


2022-04-29 09-08-10
Pramod Torase

Not in widget tree

I m saying in the logic flow.

Can you tell me what is exactly what you want to achieve/exact requirement so that I can help you better.

UserImage.jpg
Md Mansur

I Have a If Condition on UI,

 1. If Condition Is false than Print Text( Done)

 2.If Condition is true

      a. Print a text(Done)

      b. I have a local variable  like Position and we want to assign  the value Like 1


This is my requirement 

How to assign local variable value ????





2021-09-06 15-09-53
Dorine Boudry
 
MVP

please read the replies people are giving you,

this is not something to be done in an expression on your ui, it is something to be done in an action flow.

2022-04-29 09-08-10
Pramod Torase
Test.oml
2021-10-08 05-01-12
Deepa Tiwari

Hi @Md Mansur ,

dont use this type assignment use like below image-



hope this will help you.

UserImage.jpg
Md Mansur

I have a expression and in this expression I have if condition ( If condition is true than Assign value in local variable

UserImage.jpg
Md Mansur


My req is   I have a expression and two local variable 

1. date

2. position

In expression First Check If Condition(Date = CurrDate())  if condition is false simple print a text and if condition is true than 

print a text and also assign a value to local variable like Position .

Is it Possible???


Please check this??




2022-01-13 08-29-52
Saravanan Santhanam

Hi @Md Mansur 

Can you please look at the below OML, If you need something like this, I did some work around using JS for your use case.

https://saravanan-gamechanger.outsystemscloud.com/RememberMe/LocalAssign?_ts=637952263724422508

I hope this helps!

Regards,

Saravanan Santhanam.


RememberMe.oml
2020-06-10 05-06-30
shehroze khan

Hi MD Mansur ,

If understood you correct, you have input on the screen and expression is also on the screen,


then on change of the input you give , on change action In the on change event flow you can assign values as per you requirement,


  on expression you can give,

if(date=currdate(), position , Not current value)

You can mark this post as solution if it helps you,


Thanks 

Shehroze khan

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi MD,

It seems you are thinking as if you are programming JavaScript, with Console.Write() and whatnot. This is not how OutSystems works! Showing/hiding text on a screen is done by using an If widget on the screen, that is triggered by some condition. Setting a variable to a certain value is done by using an If node on the logic canvas, combined with an Assign node.

If you want to show a certain Text on screen, and assign a variable at the same time, you have to use an If node, and an assign of that variable, and possibly an assign of a second variable that's used in the condition in the If on the screen (only when the condition can't be directly derived from the variable).

On the screen:

Condition properties:

In your logic:



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.