---
title: "Create an input screen"
description: "Create an item-entry view and open it with navigate.link()."
permalink: /docs/get-started/tutorial-build-your-first-app/build-a-workflow/create-an-input-screen/
---
# Create an input screen

Site Inspector now lists open issues, but so far you've created those records through OXIDE's data browser. Inspectors need a way to report an issue directly in the app while they're on site.

In this step, you'll create a separate view called `add_new`, with inputs for a photo and comments. Each time the view opens, its JavaScript will create an unsaved Item object with the status **Open**. Binding the inputs to that object's fields lets the inspector fill in the issue details.

You'll then add a button to the main screen that opens this form. By the end of this step, you can navigate from the issue list to the form and enter details. The next step adds saving and returning to the list.

## 1. Create the form

In OXIDE's **Views** panel, use **+** to create a view with the path "add_new".

<Tip title="Find actions with the command palette">

Press **Shift** twice to open OXIDE’s command palette, then type **Create view**. The palette lets you find actions without having to remember which panel contains them.

</Tip>

![Create View dialog with add_new entered as the view path](media/create-view.png){:.medium}

Replace its XML with:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<view title="Add New Issue">
    <var name="item" type="item" />

    <capture-photo bind="item.photo" source="any" required="false" />
    <text-input bind="item.comments" required="false" />
</view>
```

`source="any"` offers both the camera and the photo library. When testing in a browser, choose a photo from your device.

Set its JavaScript `init()` function to:

```javascript
function init() {
    view.item = DB.item.create();
    view.item.status = "Open";
}
```

`DB.item.create()` creates an unsaved Item object. The inputs edit its `photo` and `comments` fields, but it is not yet stored as a database record. In the next lesson, you will add a Save button that saves this object and returns to the list. For a single-choice field such as `status`, assign the option's **key** from the data model.

![OXIDE simple mode with the new issue inputs and initialization code](media/input-editors.png)

## 2. Link from the main view

Add this button below the list in the main view's XML:

```xml
<button label="Add New Item" on-press="goToNew" validate="false" style="solid" />
```

Add the handler to the main view's JavaScript:

```javascript
function goToNew() {
    navigate.link('add_new');
}
```

The first argument to `navigate.link()` is the target view's path. It must match `add_new` exactly.

## 3. Test navigation

Run **Deploy to testing**. Press **Add New Item** and check that the form opens with photo and comments inputs.

The form is ready to capture an issue. Next we'll add its Save button.

![New issue form with optional photo and comments inputs](media/empty-form.png){:.small}

## What you learned

You created an unsaved Item, bound form inputs to its fields, and opened the form with `navigate.link()`. Next you will decide when those edits become a saved record.

<DocsReference href="/docs/get-started/tutorial-build-your-first-app/build-a-workflow/save-and-return/" variant="next" />
