Improve the usability of your mobile app by configuring and enabling global
search functionality. You can guarantee more meaningful search results and increase the
speed of the search by limiting the scope of the search to specific case
types.
For example, in your Expenses mobile app, apart from the expense reporting case type, you
have a case type in which users submit requests for a per diem allowance. You can add
both case types to the search configuration, and provide users with search results that
the mobile app displays in categories. After configuring the search categories, you can
add the Search action to the menu bar of your mobile app, to provide a convenient method
of initiating the search.
Before you begin: Prepare the framework for the search gadget:
- Create a mobile channel for your mobile app. For more information, see Setting up mobile apps.
- Ensure that you have case types and instances that the mobile app can use as
search categories. For example, create a case type that handles expense
reporting and a case type that handles requests for per diem allowances. For
more information, see
Creating a top-level case type.
If you do not define any search categories, the mobile app
searches all content and displays it as uncategorized results on one tab.
-
Open your mobile channel:
-
In the navigation pane of
App Studio, click Channels.
-
In the Current channel interfaces section, click
the icon that represents a channel for your mobile app.
-
On the mobile channel page, on the Content tab, click
the Search category.
-
In the Case types section, click Add case
type, and then select the case type that you want to use as a
search category.
At run time, the name of the search category in the search results is the same
as the name of the case type that you add.
-
In the search case type configuration window, in the Data
view field, enter the data page that you want to use as the
source for the search category.
Note: Offline-enabled mobile apps download all data for the search categories
during the first startup after installation. Avoid adding data sources with
a large amount of data, to decrease the startup time of an offline-enabled
mobile app.
- Optional:
To change the default icon of a search category, next to the current icon,
click the Change button, and then select the icon that
you want to use:
-
In the icon selection modal dialog box, click the Show image
viewer icon.
-
In the Image catalog window, enter an image name,
and then click Find.
-
Select the image that you want to use as the default icon for the
search category, click OK, and then click
Submit.
Important: Search category icons only support .png image
types.
-
In the search case type configuration window, in the List item
information section, configure how the mobile app page displays
the search results:
-
In the Primary field, enter the property that
you want to use to populate the label of the search result at run
time.
-
In the Secondary field, enter the property that
you want to use to populate the secondary text of the search result at
run time.
For example: You can use the following field and property configuration to display the
search results for expense reports:
- For the Primary field, add the
Label property that defines the expense
report name.
- For the Secondary field, add the
Amount property that defines the total amount
of the expense.
- Optional:
To add more categories, repeat steps 3
through 6.
Note: When you add two or more categories, the mobile app also displays the
All category when users perform a search.
This category displays all search results in a single tab.
-
Click Submit, and then click
Save.
Note: Changes to the search configuration apply to all mobile channels in your
application.
-
Add the search action to the menu bar of your mobile app:
-
On the mobile channel page, on the Content tab,
click the Navigation category.
-
In the Navigation section, click .
-
Click Save.
Result: At run time, your mobile app now has a search icon on the
menu bar that users can tap to start looking for information. The mobile app groups
search results by the categories that you defined. Each result has a label and secondary
text that help users choose the best search result. When a user taps a search result,
the mobile app opens the relevant work item.