471
Views
10
Comments
Solved
How can I return value from Javascript ?
Application Type
Traditional Web

Hi,

I need to capture a value from javascript code and need to assign it to a variable, how can i achieve the same?


thanks,

Bhuvan

2025-03-19 01-45-51
Sandeep Kumar Kolli
Solution

Hi @Bhuvan Chandra Vechalapu ,

Kindly check the OML that you sent to me personally, I've modified it to fit your requirement.

thanks,

Sandeep.

Trad.oml
2022-05-02 13-50-49
Paulo Ritto

Hi, this has been answered before, take a look at the solution answer in this post:

https://www.outsystems.com/forums/discussion/40098/how-to-assign-javascript-value-to-out-system-local-variable/


let me know if it was useful!

Cheers,

Paulo

2025-02-10 17-24-13
Arun Rajput

Hi @Bhuvan Chandra Vechalapu ,

You can use input field to get output from javascript.

What you need to do:

1) Take one input field and name it sometimes like JSoutput.

2) now use this input field id in your javascript code where you can assign your output in innerhtml of input.

3) once you assigned your output in innerhtml of input the variable you are using in input it will be hold output value and you can use it as you want.

Thanks,

Arun

2025-04-17 05-42-16
Ajit Kurane

In addition to above answers you can refer below solution if its useful for your usecase.

https://www.outsystems.com/forums/discussion/63166/how-to-bind-the-result-of-javascript-function-in-web-app-to-outsystem-local/

Thanks.

2023-07-25 17-04-53
Mohit Sharma

Hi @Bhuvan Chandra Vechalapu

You can simply do it using Output parameter in JavaScript tool and assign it to you variable 



I created a .oml file for you, please check. 

JSLocalVar.oml
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

read the question carefully before replying, this is a out traditional web. $actions. is only available for reactive web and mobile

UserImage.jpg
emanuele mantovanelli

you saved me!

2023-09-06 07-26-35
Sudip Pal

Hi Bhuvan,

You have already an action which is used to trigger the JS code.

In my case, the action which will trigger the JS code is "Action_That_Will_Trigger_JS".After triggering this button the output will be saved to the local variable. (To show the value of the variables in UI, I have triggered "Show the output of the JS" this button.) 

I am attaching the OML file .Please check it and let me know if you face any difficulty. This solution is for traditional.

Thanks & Regards,

Sudip Pal

Demo_Js.oml
2025-03-19 01-45-51
Sandeep Kumar Kolli

Hi @Sudip Pal what is the use of JS that you defined at screen level?

2023-09-06 07-26-35
Sudip Pal

Hi Sandeep,

This is a demo .oml . You need to put JS according to your need then take/store/return the output of the JS like whatever I applied in that demo.

Thanks & Regards,

Sudip Pal 

2025-03-19 01-45-51
Sandeep Kumar Kolli
Solution

Hi @Bhuvan Chandra Vechalapu ,

Kindly check the OML that you sent to me personally, I've modified it to fit your requirement.

thanks,

Sandeep.

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