Reactive web - Set Client variable using server logic

Previously in traditional apps, I can just do something like "ID" = Encrypt(somevariable).

Now with Reactive web apps, there is client variable which I read is equivalent or somewhat similar to a session variable. However i'm having trouble assigning a variable from server to client variable.

Say i'm trying to assign a client variable "ID" and this value will go through an encryption function I created under the Logic tab.

I noticed from "Fetch data from other source" data action I have access to both Client variable and Server logic / function where I can do something like 

ID = Encrypt(somevariable). I'm guess this is the only way where I can access both client and server stuff am I right?

# Use Client Action to Call Server Action

# In the Client Action, just assign the variable client ID = server action return value

I basically created a Client Action for my Client Variables so that I can call them anywhere in the screen actions that needed it.

On my example, I basically get and set JSON text for my client variable since it can't be set to a structure only basic types (text that is). I just added a sample server action here just to test if it is possible. So I guess in your case, you can create a Client Action and on it, call that Encrypt thing and set the Client Variable of yours and then output it in this Client Action.