One common situation when people are taking the first steps in this awesome world of OutSystems is trying to use data that are out of scope.
In this article, we are going to explore some situations where maybe you will not get the results that you want!
You can see an example of this is the situation shown in the image on the left.
If all the possible routes begin at the Start node, all of them need to pass through the ActionBefore. The output of that action will be available throughout the whole flow.
But if you try to use the output of the ActionLeft or ActionRight nodes, you won’t be able to use it after the flows converge on ActionAfter. And the reason is simple: we don’t know if that data will be available.
If you are coming from the left branch and then in the AssignCommon you have “var = ActionRight.Out”, the assign is trying to get a value that might be empty, and we don’t want to have an ambiguous situation like that in our action.
It is particularly important to have this in mind at Preparation. If you split the Preparation flow, add there a SQL query or an aggregate, and then try to use that data source on a widget, both will be available but the results might, once again, be empty.