252
Views
4
Comments
How can my slient Action wait for a  javascript to be finished before continuing
Application Type
Reactive

I Have this flow and I want to finish the javascript1 first before going to the next action.


what happens is that it assigns the value once the screen has finally been loaded.
I've already tried adding resolve in my javascript, heres the code inside my javascript:
tried putting resolve everywhere and it seems its still not commiting.

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

Hi,

Did you validate your JavaScript is actually executed successfully, by using Chrome debugger or some console.log statements?

Your code does not show where the webAuth.checksession function is called, maybe that call does not happen?

Regards,

Daniel

UserImage.jpg
nikkoli castilan

Hi Daniel,

yup the javascript is executed successfully and the result is showing up after it went to the next screen.

I tried putting an alert("test") and it seems to be showingwhen loading the next screen

2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Hi Nikkoli,

Check this docs about asynch calls in Javascript and promisses in returns, it may help.

Specially this part:


You can set something to happen after your JS is executed.

And when you use Resolve(), your entire action will be asynch see:

Hope it helps.

Cheers and Regards,

RR :)

2020-07-29 19-08-40
Sanjay Kumar Sahu

Hello Nikkoli,


In general, for this kind of requirement, I use screen events. I write my JS code in OnReady event and use JS output data in OnRender(to assign data in some element) event. In this way, I always got proper data. 


Sanjay

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