Navigation methods can be used in MyDataHelps Views to move the participant to a different screen or dashboard. In native apps, these can change which application is active.
Contents
There are several ways to navigate within MyDataHelps.
Tabs are the main screens used in your project’s dashboard. You can change the active tab using the MyDataHelps.showTab
method.
You can open URLs outside MyDataHelps in two ways:
MyDataHelps.openExternalUrl
. This will leave MyDataHelps and open the system browser (on native iOS/Android apps) or a new browser tab (on web).MyDataHelps.openEmbeddedUrl
. In the native iOS/Android MyDataHelps apps, this will remain within MyDataHelps and show the page using an embedded browser. On web, this will open a new browser tab.You can present custom views within MyDataHelps both modally and non-modally.
Use MyDataHelps.openApplication
to show a view. You may append query string parameters to your view’s url if needed, such as to show a specific object.
By default, the view will be shown in a non-modal mode. To go back, you must call MyDataHelps.back
to “pop” the current view off the stack. In the native iOS/Android MyDataHelps apps, this uses a “push” transition. The new view slides in from the right.
You can also present views in a modal window by passing modal:true
to the openApplication
options. This creates a “stack” of views. From the modal window, you can present additional views non-modally and then use MyDataHelps.back
as normal to “pop” them off the stack. MyDataHelps.dismiss
will dismiss the modal window and everything in it’s “stack”. In the native iOS/Android apps, a modal view slides in from the bottom and is presented “on top” of the current one.
In the native Android MyDataHelps app, MyDataHelps.showGoogleFitSettings
method will open the Google Fit settings.
MyDataHelps.openExternalUrl(url)
Opens a url in the system browser. In native apps, this will cause the user to leave MyDataHelps.
The URL to open.
MyDataHelps.openEmbeddedUrl(url)
Opens a url in an embedded browser. In native apps, this will leave the user in MyDataHelps.
The URL to open.
MyDataHelps.showTab(tabKey)
Switches the participant’s view to the specified tab. Tabs are the main screens used in your project, and each has a unique key. You can find the keys for your project’s tabs in your project settings screen under “App Layout”:
You can change the tab key by selecting the edit icon for each tab. The tab key is under “Advanced” tab settings.
The key for the tab you want to show.
MyDataHelps.openApplication(url, options)
The URL of the external application.
A javascript object. Set properties to control the operation. The only available option is modal
; set to true
to present the application modally.
MyDataHelps.dismiss()
MyDataHelps.back()
MyDataHelps.showGoogleFitSettings()
Opens the Google Fit configuration screen. This will only work when accessing MyDataHelps via the native Android app, so you would want to check the Current Device Information before presenting this as an option.