Server Action

I have a server action called 'CalculateInterest' with Public property and Function property set to yes. Can I use this server action as a direct expression in the screen?

Yes or No ?


FunctionSet to Yes to define the action as a function. Functions must return a value and can be used in expressions.YesNoThis property is only available in global scope actions. Server actions set as functions can only be used in server action expressions.
mvp_badge
MVP
Solution

Hello there Amol,

Hope you're doing well.


As per my understanding, you are asking this because it could be a question of the Associate Reactive Web Developer Exam.


The answer is no. You cannot use a Server Action with the Function property set to Yes as a direct expression in the screen (for a Reactive Web / Mobile application).


There are indeed some workarounds like calling this Server Action inside a Data Action and associate the output to a screen variable. But it's just a workaround in order to achieve a similar behavior.


The answer that you are looking for is: No (for a Reactive Web/Mobile App).

For a Traditional Web App, then the answer would be Yes.


Hope that this helps you!


Kind regards,

Rui Barradas

Thanks.Rui Barradas 

I am looking for Reative exam perspective.

SO i got the answer now.

Just on server expressions. But you can create a client action and put it as a function or you can call that server action and put in a data action and retrieve it as an output, By doing that you can use it in an expression.

Look at this thread, @Rui Barradas explains how to do it

https://www.outsystems.com/forums/discussion/72838/server-action-not-available-in-expression/#Post297762

Kind Regards,

Márcio


Hi amol,

Yes!
But not directly

if you are using client action set to yes you can use in the screen directly  .

For server action you can use it by get data from other sources and use expression in the action and then you can use in the screen .

Champion

Hi Amol,

Server Action function property set to yes - > You can not use that function directly in screen. Indirectly you can. First call that function in  some client or data action and assign output of that function in some variable. Now you can use that variable value in screen. 


if you just want to perform some calculation. It's better to make client action as function and now you can directly call client action in screen. 


Regards,

Rahul

So what will be the answer if question comes on exam?


What I got answer is No.. is it correct?

Champion
Solution
mvp_badge
MVP
Solution

Hello there Amol,

Hope you're doing well.


As per my understanding, you are asking this because it could be a question of the Associate Reactive Web Developer Exam.


The answer is no. You cannot use a Server Action with the Function property set to Yes as a direct expression in the screen (for a Reactive Web / Mobile application).


There are indeed some workarounds like calling this Server Action inside a Data Action and associate the output to a screen variable. But it's just a workaround in order to achieve a similar behavior.


The answer that you are looking for is: No (for a Reactive Web/Mobile App).

For a Traditional Web App, then the answer would be Yes.


Hope that this helps you!


Kind regards,

Rui Barradas

Thanks.Rui Barradas 

I am looking for Reative exam perspective.

SO i got the answer now.

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