Hello, I am new at learning Reactive Web Development on Outsystems. I managed to do the exercises on the Actions and Flows Topic on my Own.
But I am still confused on Variables specially between Input Parameter and Local Variables. Though I get how Output Parameter works.
Sometimes I don't know if which one to use and the exact difference. Can someone give me examples in detail on how to:
I wanted to see the detailed difference and a scenario when to use them!Thank you in advance!
Hi Cyrus Gamboa,
In the image given below i want to have input in the screen client action so for that i have take an input from screen.
For server action, if i want something from outside the server action i need a input parameter that will take the values from the place where it is used.
Now, For Local Variables understand it like this that it is having a defined scope.Let's say if we have a Screen and we have a local variable so it is just used inside the screen only if screen is destroyed than local variable is destroyed. Same goes with client and server action local variable inside those will have only defined scope they will be only accessed within the actions. we cannot use them to get data from outside or send data from outside the action from the actions or screen.
Hope this helps you in understanding the concept.Thanks
Hi,
Input variable is variable that get value when you call your Screen/Client Action/Server Action. You must assign this value by yourself (and depend whether it is mandatory or not, this can be empty).
Local variable is variable that you use to keep value on the Screen/Client Action/Server Action. This can modified by logic and not assigned when you call the Screen/Client Action/Server Action.
The abstraction is like this:
Think Screen, Client Action, and Server Action each as a House. Input parameter is a box used to send food (value put in the input parameter) into the house. Inside the house, the food can be processes further using local variable, say it Microwave - and the once it is hot, you can send out that 'hot food' put in same/another box (output parameter) to anyone who needs it outside the house.
regards
Hi Cyrus,
Local Variable - used to store data temporarily within the scope of a screen, or action. Typically used for intermediate calculations, storing user inputs, or any data manipulation within the context of a specific operation. They have a specific data type and can be assigned values dynamically during runtime.
Input parameters - used to pass data into a screen, or action from its parent or from another screen, or action.
Output parameters - used to return data from a action to its parent or to another action. They are commonly used to pass back results of operations, or any other output produced by a component.
Please do refer this Outsytems Documentation for better understanding.
Regards,NK.
Hi Cyrus
How you mark this answer as solution. I am also a beginner in outsystems.
Screens and blocks don't have output parameters, but this guy @Nandhakumar S tells "Output parameters are used to return data from screen" It's impossible.
@Nandhakumar S please refer documentation first from your end. Your rank is 796, if you give answers like this , freshers like us mislead in the wrong way.
Regards
Pranav
Hi @Pranav Pandey,Thanks for letting me know, Apologies for the mistake. I had just mistyped in a matter of time. And it's not about misleading or something else. It's all about helping people. It's human error.
@Nandhakumar S it's a bad practice among community to dislike the comment which points your wrong answer. Please don't continue this, I may new to outsystems but I didn't found any community members will do like this in other platforms.
I am sorry if I hurt you anything personally. I just commented for community
Hello Guys, Thank you so much for your inputs, I will try to apply these on future exercises. Hopefully I won't get confused again. Because sometimes I mistakenly used input parameter instead of local variable and vice versa specially when I work on a single screen.
Here the example oml
Thank you so much. I will check this out. And try them.. 🙏