Saving a user's last search action

To save the user’s last search action, you need to create your own search form. It will save the last search action in the assigned data item.

When the user enters the user flow, the search string will be present in the search field, so the user can use it again straight away.

1. Add a specific property to the Data item

  1. Add the Any text property Last search to preserve the search text you used.

2. Create the Flow part

For every search action you use in the application, you need to create a flow part. In this example, the search button is included in the page My answered questions. The flow part must find the answered questions of the current user that contain the search text.

Flow part

  1. Define two inputs: the Current user and the Search text.

  2. Create a look up for the questions that the current user has answered AND that contain the search text.

  3. Use the function TEXT A CONTAINS B.

  4. Within that function, convert both the question and the search text to lower- or upper case, so all matches will pass the filter.
    Rule
    Function

  5. Add the look up to the output of the flow part.

3. Create the User flow

User flow

  1. Include the form field Search in the left column.

  2. Make it prefilled with Current user / Last search.
    Prefilled form field

  3. Close the page and add the button named Search to it, that submits the form fields.
    Add a button

  4. Add the flow part Update User, which will store the search text in the User profile. Provide it with Current User and Search text.

  5. Add the flow part Search in my questions. Provide it with Current User and Search text.

  6. Add the page Search results .

  7. Add a table.
    Add a table

  8. Since the table will present the search results that were generated in this user flow, select Data from the user flow.
    Data for the table

  9. Point to the search results list.
    Data for the page

  10. Complete the questionnaire for the table.

  11. Bonus: modify the title of the page to show the search text.
    Page title

  12. Publish the design.

4. Results

The search button in the overview page.

Search button

The search results
The results show both lower case text and mixed case text (“in” and “In”).

Search results