# Pre-selecting Finder Questions

### Overview

The <kbd>`crobox.setFinderState`</kbd> method allows you to control various aspects of the Finder experience, such as pre-selecting answers for specific questions and managing page navigation during the interaction.

This method should be used in addition to the pageview event. It is not part of the pageview event itself.

**Key Features**

* Set pre-selected answers for questions
* Control page navigation, either by skipping certain pages or showing a page with pre-selected answers.

### Implementation

To implement the `crobox.setFinderState` method, you will need to include it in your `crobox.push()` call, which initializes the interaction with the Crobox API.

#### Example Snippet

Below is an example of how to set the Finder state with the `crobox.setFinderState` method. Note that the references below (such as `{shoe-finder}` `{page-gender}`, `{gender}`, `{men}` and `{page-category}`,`{category}` and `{trail}` ) are used as examples for the finder key, page key, question key, and answer keys. You should replace these placeholders with the appropriate keys specific to your Finder.

{% code overflow="wrap" fullWidth="false" %}

```javascript
window.crobox = window.crobox || [];

crobox.push(function(crobox) {

// Set answers for the Finder (e.g., skip a question page for a pre-selected answer or show the user a pre-filled answer within the question page)
  crobox.setFinderState('shoe-finder', {
    'page-gender': '1',  // Page is submitted (‘1’), otherwise omit the element
    'gender': 'men',     // Question ‘gender’ is answered with: 'men' (other option: 'women')
    'category': 'trail'  // Question ‘category’ is answered with: 'trail' (other options: 'road', 'hiking')
  });
});

```

{% endcode %}

**Explanation**

`crobox.setFinderState():` This function sets the state for the Finder based on the values you define. In this example:

* **Gender question:** The page key page-gender is submitted, which corresponds to the page being skipped for the user within their finder interaction. The question key gender is set to 'men', which corresponds to the answer 'men' in the Finder.
* **Category question:** The page key page-category is not included in the push, which corresponds to the page being shown to the user in their finder interaction with the answer pre-filled. The key category is set to 'trail', indicating the user is interested in trail shoes.

You can control whether the page is shown with pre-selected answers or skipped entirely. The setFinderState method allows you to navigate directly to a specific question, the ‘page-gender':’1’ example is used above.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.crobox.com/technical-documentation/pre-selecting-advisor-questions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
