Fetch result from JS continuosly | Outsystem Mobile


I have created an action & written a JS in it, where I am generating some results continuously after some seconds.

I want the JS result generated regulalry to be reflected on my outsystem variables.



I would suggest that you use a regular Assign widget in your client side action to update the OutSystems variables. Don't do this in JavaScript, do it using OutSystems logic. If you really NEED your results to be generated in JavaScript, because you are using a library, create output parameters for your JavaScript widget and then assign those outputs to OutSystems variables in your screen. For those those variables to be updated continuously (let's say, adding more results), you should run a setInterval, calling the client side action that updates the variables.

Let me try to be clearer:

  1. Create a client side action that generates results and assigns them to OutSystems variables (let's call it generateResults);
  2. Create a client side action (let's call it startGenerator), in your screen, action that runs a setInterval(generateResults, 1000), for example;
  3. Use startGenerator as the handler for the OnReady event of your screen.