65
Views
2
Comments
Assign value in a variable using javascript

I am using websocket in my application i am calling the websocket via javascript Now i want to assign the response i am getting via websocket trough javascript into  a local variable in outsystems but after trying multiple times i am not able to assign the value into the local variable

2022-05-02 13-50-49
Paulo Ritto

Hi @Piyush Vijay ,

1. Make sure you have an output parameter in your JS Node

2. Make sure, in your JS code, that you assign your result to that output parameter

3. After the JS node, make sure you  assign the Output result of your JS node to your local variable


if you need further help than these general pointers, please share more info, either the .oml or some pictures of the situation


Let me know if this helps!

Paulo 

2026-02-06 06-25-47
Mohan Sigamani

Hi Vijay, 

        I'm kind'a faced this type of problem while workaround with javascript.

To solve this

1. Creating Assign Action

            Create a screen action that has 1 input parameter.

             Assign your local variable whichever comes from the input parameter.

2. In your web socket action, open the js node where you can find your needy value and the value to assign to a variable right?

        Below the expression panel, you can find the Assign Action which we created earlier. 

        Click the action and get where you want in the javascript. 

         THEN, pass the value in the brackets of the action like this AssignAction(your value).

   It will solve your problem.

Hope it will help you.

Regards,

 Mohan

      

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