Navigation
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.
There are several ways to navigate within MyDataHelps:
Navigating Between Dashboard Tabs
Tabs are the main screens used in your project’s dashboard. You can change the active tab using the MyDataHelps.showTab method.
Show Tab
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 Designer”:
You can change the tab key by selecting the edit icon for each tab. The tab key is under “Advanced” tab settings.
Parameters
tabKey
string
(required)
The key for the tab you want to show.
Availability
Navigating Between Views
You can present custom views within MyDataHelps both modally and non-modally.
Note
A view must undergo a
security review and be registered with your project before it can be used.
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. You can also use MyDataHelps.openSecondaryView to open a secondary view by project/key rather than by URL. This insulates your code if the secondary view is modified and gets a new URL.
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.
Open View
MyDataHelps.openApplication(url, options)
Opens a custom view. See Navigating Between Views for details.
Parameters
url
string
(required)
The URL of the external application.
options
Optional properties to control the operation of the view.
Child Fields
options.modal
boolean
Whether to open the application as a modal.
Availability
Open Secondary View
MyDataHelps.openSecondaryView(projectId, viewKey, options)
Opens a secondary view (identified by project/viewKey rather than URL). See Navigating Between Views for details.
Parameters
url
string
(required)
The URL of the external application.
options
Optional properties to control the operation of the view.
Child Fields
options.modal
boolean
Whether to open the application as a modal.
Availability
Dismiss Modal View
MyDataHelps.dismiss()
Dismisses the entire “stack” of modal views. See Navigating Between Views for details.
Go Back in Modal Views
MyDataHelps.back()
Goes back a step in the “stack” of modal views. See Navigating Between Views for details.
Navigating to External URLs
You can open URLs outside MyDataHelps in two ways:
- Outside the app using
MyDataHelps.openExternalUrl. This will leave MyDataHelps and open the system browser (on native iOS/Android apps) or a new browser tab (on web).
- Within the app using
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.
Note
You cannot access the MyDataHelps JavaScript SDK from pages opened as external or embedded URLs. Use
custom views instead.
Open URL Outside the App
MyDataHelps.openExternalUrl(url)
Opens a url in the system browser. In native apps, this will cause the user to leave MyDataHelps.
Open URL Within the App (Native Only)
MyDataHelps.openEmbeddedUrl(url)
Opens a url in an embedded browser. On web, this functions identically to MyDataHelps.openExternalUrl.
Showing Device Settings Screens
In the MyDataHelps mobile apps, there are SDK methods to show native device data collection configuration screens/prompts. See Native Device Data Settings for details.