How to Call JavaScript_API from Client Action - Mobile Apps

Hi,

I want to call OutSystems JavaScript_API functions from following URL.
https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API

Specifically, I want to call following function using my JavaScript code.

navigateTo(url: string, [transition: TransitionAnimation | string], [replace: boolean]): void


In one of my application scenario, I want to redirect user from one screen to another screen using javascript.

But I don't understand how to call this function directly.

What I understand is I need to use, $public.Navigation in my code.
But when I use following code in my javascript, its giving me error $public is not defined.
$public.Navigation.navigateTo(ScreenName);

Do I need to add any dependencies in my code?

Has anyone used this kind of functions successfully?

Thanks in Advanced !

Regards,
Palak Patel

Hi Assif,

Thanks.
I already checked this post.

But my question is how to use $public.Navigation.navigateTo(ScreenName);
When I use this function in my javascript, its giving me error $public is not defined.
Do I need to use any dependencies for this ?

Regards,
Palak Patel

Hi Palak.

Please refer this attached sample.

I have implemented as per  Daniël Kuhlmann Solution.

Note:

Created 2 screens.

1-Redirect : Home Screen

2-Destinatiion

Have define the JS in onIntialize of HomeScreen to goto Destination Screen

Hope it will help you

Thanks