> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/directual-step-by-step/open-development-pipeline/step-4-watching-the-features.md).

# Step 4. Watching Features

## Step 4.1: Email Confirmation

{% embed url="<https://youtu.be/srYAF1imzho>" %}
15:49
{% endembed %}

Set the default role `not authorised` for every new user (object from `WebUser`) and create a simple scenario:

![](/files/-MbA_EpiHSK-U1rRQbZt)

Add two data structures.

`ConfirmRequest` with the following fields:

* `user_id` — link to `WebUser`
* `code` — type of string
* Fields for sync [result processing](/web-pages/components/legacy-components/form.md#online-result-processing)
  * `is_success` type of boolean
  * `result_title` type of string
  * `result_text` type of string.

`CodeRequest` with the following fields:

* `user_id` — link to `WebUser`
* Fields for sync [result processing](/web-pages/components/legacy-components/form.md#online-result-processing):
  * `is_success` type of boolean
  * `result_title` type of string
  * `result_text` type of string.

Create a new web page called '**Watch features'** and add two [conditional sections](/web-pages/setting-up-pages-layout.md#conditional-sections-visibility):

* The first section is visible only for users with the `not confirmed` role and includes two forms:
  * Form for submitting `ConfirmRequest`
  * Form for submitting `CodeRequest`
* The second section is visible only for users with the `confirmed`role.

![](/files/-MbA_uDS2p-VoFma0Ykg)

The '`CodeRequest'`form triggers a scenario in sync mode, which generates and sends a code to the user. The code is then saved in the`WebUser` object.

![](/files/-MbAbCTW3e_uJdA3Lswi)

The '`ConfirmRequest`' form compares the provided code with the one saved in the the '`WebUser'` object. If they match, the role '`not confirmed'` is removed, and the role '`confirmed'` is added to the '`role'` field in the '`WebUser'` object.

![](/files/-MbAbiRra4R3vqgUJm7_)

## Step 4.2: Watching Features

{% embed url="<https://youtu.be/FoRWMmOcn-g>" %}
12:34
{% endembed %}

Create a new data structure called 'WatchRequest' with the following fields:

1. 'user\_id' – a link to 'WebUser.'
2. 'feature\_id' – a link to 'features.'
3. 'type' – a string type to store 'watch' or 'unwatch'."

Add a new field 'users\_watching\_ids' with the type 'arrayLink' to the 'Features' data structure.

Create a new API-endpoint and a new web-page named 'Watch features.' In the endpoint, set a filter 'users\_watching\_ids arrayContainsAny {{id}}' to select only the features where the user's ID is in 'users\_watching\_ids.'

Now, add two actions:

1. 'Watch' on the 'Upvote features' web-page.
2. 'Unwatch' on the 'Watch features' web-page.

Scenario for processing WatchRequest (can be either synchronous or regular)

![](/files/-MbAli7EyQyxgXJbtwNT)

Next, create a new scenario triggered by changes in the development\_status and request\_status fields of the feature object. This scenario sends objects from the users\_watching\_ids to the 'Notify users' scenario, passing the feature\_id as a parameter ([context variable](/scenarios/using-variables/context-variables.md)).

![](/files/-MbAmScZ3YmCOcOH5Eiq)

That is it! Thank you for using Directual. You can find the Open Development Roadmap app among our free templates.
