Skip to content

Search Pages

A Search page lets a person find and continue a saved draft of a Factorial Form, or start a new record. Set up the search terms on the form first, then configure the Search page. The person can only continue records they are allowed to access.

Set up search terms on the form

  1. Open the form for editing and select Search and Submit.
  2. Turn on Enable Draft Form Search.
  3. Under Search Parameters, click Add for each term you want to use. Choose a Type and Identifier:
Type Identifier
Form Field Select the form field whose entered value will be used for the search. Make sure the person can provide this value before reaching the Search page.
Query Parameter Enter the name of the value supplied in the form's URL. Use this when the form is opened with a search value from another page or application.
  1. Leave Required on for terms that must have a value before a draft can be found. Turn it off for terms that may be absent. At least one search term must be required.
  2. Save the form.

Search terms use exact matches. Every supplied value, whether required or optional, must match the corresponding value on a saved draft. An optional term with no value is omitted from the search; if it has a value, it narrows the results. If a required term has no value, no draft is found. For example, if email is required and reference is optional, supplying both values finds only a draft matching both; leaving reference empty searches by email alone. Search does not find partial words or similar values.

Add and configure the Search page

Follow Manage Pages to add a page to the form or edit an existing one. On the page's Basic Info tab:

  1. Set Type to Search Page.
  2. Choose Show Search Results As:
Option What the person sees
Show Dialog When a draft is found, a dialog offers Continue Existing or Create New Record. If none is found, the person proceeds with a new record.
Auto Resume Existing When a draft is found, it opens without a choice dialog. If none is found, the person proceeds with a new record, unless you enable the no-results dialog below.

Show Grid is currently unavailable in the portal.

  1. Set Search Batch Size between 1 and 100 (default 10). This is the number of records checked at a time while finding an accessible match. It does not set the number of results displayed.
  2. Choose Sort By and Sort Order if needed. These settings apply to grid results; they do not change which matching draft is selected for the dialog or automatic resume.
  3. Choose When Creating a New Record for a matching draft:
Option What happens
Keep Existing Drafts Starts a separate new record and leaves matching drafts in place. This is the default for existing Search pages.
Delete Matched Draft Starts a new record and requests deletion of the draft shown in the result.
Delete All Matching Drafts Starts a new record and requests deletion of every accessible draft matching the same search terms, including drafts beyond those shown in results.
Prompt User Shows a separate decision dialog with a keep choice and the delete choices you allow. Choosing Keep Existing starts a separate new record and leaves the matched draft in place.

Deletion is a best-effort tidy-up action. The new record starts without waiting for deletion, so an occasional failed request can leave old drafts in place. 6. For Prompt User, choose Allowed Prompt Delete Actions: Matched Only, All Only, or Matched or All. Keep Existing is always offered. 7. Set the remaining page details, then save the page.

Design the found-record dialog

With Show Dialog selected, click Configure beside Found Record Dialog Template. Edit the HTML to explain the choice in language appropriate for your form. The default template includes the record reference and last updated date. You can retain these placeholders in the dialog text:

Placeholder Displays
[[SEARCHMETA_ReferenceNumber]] The matched record's reference number.
[[SEARCHMETA_LastModified]] When that record was last updated.

Keep a Continue Existing button with class npo-record-existing and a Create New Record button with class npo-record-new. These classes make the buttons perform their intended actions; you can change the visible button text. Continue Existing opens the matched draft. Create New Record starts a separate record instead. Keep the surrounding dialog structure and its unique ID when editing the supplied template.

Design the new record decision dialog

For Prompt User, open the Search page's Additional Properties tab. Under Delete Confirmation Dialog Template, click Configure to edit the decision dialog. The default follows the found-record dialog's design and shows the matched record's reference and last updated date. It offers a choice to keep the existing draft and the delete choices allowed by Allowed Prompt Delete Actions.

If you customize the HTML, keep the dialog ID newRecordDecisionModal and the button classes npo-draft-keep-existing, npo-draft-delete-all, and npo-draft-delete-matched for the choices you allow. Publish checks that the required buttons are present. You can change the visible button text. The Show Delete Confirmation Dialog setting for deleting rows from a section is separate from this Search page dialog.

On the Events tab you can configure Before and After actions for Keep Existing, Delete Matched, and Delete All. A failed Before action stops that choice. For any prompt choice, events run in this order: New Record Before, the selected choice's Before and After actions, then New Record After. Keep Existing starts a new record and leaves the matched draft in place. A Delete After action runs once the delete request is started; it does not mean deletion has finished.

Use the matched record ID in an event

The ten Search choice event lists offer Search Match Id under Set Values > Set Value Type. These are the Before and After lists for New Record, Continue Existing, Keep Existing, Delete Matched, and Delete All. It is not available in Page Load, Page Unload, or events elsewhere on the form. When a draft is found, the value is that draft's record ID; when there is no match, the value is empty.

To pass the matched record ID to an Integration Workflow:

  1. Add a field to the form to hold the matched record ID. You can hide it from the person filling out the form.
  2. In the relevant Search page event list, add a Set Values action. Choose that field as Target Field and Search Match Id as Set Value Type.
  3. Add the Integration Workflow action after Set Values in the same event list. Map its input parameter to the field you populated.

For example, use Delete Matched Before to pass the matched draft's ID to a workflow before the deletion request starts. Make sure the search has a match before relying on the field's value.

Optional no-results dialog

With Auto Resume Existing selected, turn on Show No Results Modal On Auto Resume if you want to explain that no draft was found before the person starts a new record. Click Configure beside Modal Dialog Template for No Results to edit its HTML. Keep the Create New Record button with class npo-record-new; the default template also uses npo-search-no-results-modal on the dialog. If you leave this option off, the form proceeds to a new record without showing a no-results dialog.

Check the experience

Save, publish, and open the form with values that match an accessible saved draft. Confirm that Show Dialog presents both choices or that Auto Resume Existing opens the draft. Then try values with no match and check the new-record path. With a matching draft, try each configured new-record choice and check the new journey. Search again to inspect whether old drafts were removed. For Delete All, use multiple accessible drafts with the same terms and check beyond the displayed result. Also try an absent required term and an absent optional term to confirm the search behaves as intended.