> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapier.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pre-filled Zaps

> Prefills allow you to define the input fields on behalf of the user, simplying the experience of setting up their Zap.

Simplifying zap setup is one of the most effective ways to make sure the zaps created work as desired. As integration owners, you can likely pre-fill some of the zap fields on behalf of your users; making zap setup faster, easier and more reliable.

### What are they?

Pre-filled Zaps are simply URLs with field values added as parameters, which you can use to direct users to the Zap editor with some input fields already filled. Place these URLs inside your product or within an embedded Zap editor to facilitate users creating and publishing Zaps.

The following is an example of a simple pre-filled zap that sends the weather to a slack dm every day. The **latitude** and **longitude** inputs have been pre-filled in this case.

`https://api.zapier.com/v1/embed/space-by-zapier/create?steps[0][app]=WeatherCLIAPI@latest&steps[0][action]=today_forecast&steps[0][params][latitude]=40.7127&steps[0][params][longitude]=-74.0059&steps[1][app]=SlackAPI&steps[1][action]=direct_message`

<Card title="Test this pre-filled zap" icon="bolt" href="https://api.zapier.com/v1/embed/space-by-zapier/create?steps[0][app]=WeatherCLIAPI@latest&steps[0][action]=today_forecast&steps[0][params][latitude]=40.7127&steps[0][params][longitude]=-74.0059&steps[1][app]=SlackAPI&steps[1][action]=direct_message" horizontal="true" />

## Creating pre-filled Zaps using the Zap Generator

The UI-based generator within the [Developer Platform](https://developer.zapier.com/) facilitates constructing pre-filled Zaps. Start by selecting your app and navigating to `Embed` → `Pre-Filled Zaps` and scroll down to the generator.

<Frame caption="Screenshot of pre-Filled Zaps tab">
  <img src="https://cdn.zappy.app/2a4f9c6de6c525cbcdc1b513ec88c519.png" />
</Frame>

<Steps>
  <Step title="Select an app">
    Start by selecting an app and event for both the trigger and action to see
    the fields you can pre-fill. If no fields appear, the event has no input
    fields.

    <Frame caption="Screenshot of generator trigger step setup">
      <img src="https://cdn.zappy.app/87b9c4951d55298780ff209e217bb750.png" />
    </Frame>
  </Step>

  <Step title="Select the fields you want to pre-fill">
    * If you don't want to pre-fill the field, leave the box unchecked. In the
      Zap, the field will be empty or set to a default value, if there is one. -
      If there's a static value for a field that applies to every user's Zap (like
      the title of an email), check the field and provide the value in the text
      field. - If the values are dynamic or you don't know them yet, replace the
      placeholders represented in curly brackets (i.e \{TRIGGER\_LIST\_ID}) in the
      generated URL from Step 2 before using it in your app. This could be
      something like an account or list ID field. The placeholder serves as a
      reminder to replace the value at runtime. - If the field is greyed out, it
      requires a complex field value and cannot be pre-filled.

    <Frame caption="Screenshot of prefill input field options">
      <img src="https://cdn.zappy.app/9e845182506292214c866f3278861e8d.png" />
    </Frame>

    <Info>
      Fields denoting (required) are required for turning the Zap on, not
      required to be pre-filled.
    </Info>
  </Step>

  <Step title="Test the Zap">
    * Use the handy test button to make sure the resulting Zap is what you
      intended. You'll need to connect app accounts on both steps to see the
      pre-filled fields. - Copy the code and embed it inside your app to make
      setting up a Zap easier and faster for users.
  </Step>
</Steps>

The generator only supports creating 2-step Zaps, but you can construct multi-step Zaps by building upon the generated URL and adding `steps` parameters with increased indeces.

## Creating pre-filled Zaps from Zap Templates

### Prerequisites

* You will need to know the required input fields per trigger or action step. You can find the fields as defined in your [Zapier integration](https://developer.zapier.com/).

<Steps>
  <Step title="Fetch the Zap Template's create_url">
    Get the appropriate `create_url` property from the specific Zap Template desired. This can be retrieved from the [zap-templates](/powered-by-zapier/api-reference/zap-templates/get-zap-templates) endpoint. It follows the following format: `https://api.zapier.com/v1/embed/{app_name}/create/{template_id}`
  </Step>

  <Step title="Define the input values">
    The url params should be defines as follows; `step[{step_index}][params][{param_name}]`- with steps being zero-indexed. As an example, Trello could prefill the name of a Trello card `name` in the second step of the Zap template using the following:

    `https://api.zapier.com/v1/embed/trello/create/113?steps[1][params][name]=hello`

    where the `create_url` of `https://api.zapier.com/v1/embed/trello/create/113` was retrieved from the [zap-templates](/powered-by-zapier/api-reference/zap-templates/get-zap-templates) endpoint, and input fields defined in their zapier integration.
  </Step>
</Steps>

Here's what it would look like in the editor:

<Frame caption="Zap Editor showing `hello` pre-filled into the name field of a new Zap titled Create Card in Trello">
  <img src="https://cdn.zappy.app/415ac51b31ab86dbf2b1589fe524395c.png" />
</Frame>

You can prefill multiple values for the user. In this example `name` and `desc` are prefilled

```js theme={null}

https://api.zapier.com/v1/embed/trello/create/113
    ?steps[1][params][name]=yoyoyo
    &steps[1][params][desc]=yeehaw
```

* `template=113`
* `steps[1][params][name]=yoyoyo`
* `steps[1][params][desc]=yeehaw`

<Frame caption="Zap Editor showing `yoyoyo` pre-filled into the name field, and `yeehaw` pre-filled into the description field of a new Zap titled Create Card in Trello">
  <img src="https://cdn.zappy.app/278dc4d00844240ff8289bb0267db63c.png" />
</Frame>

You can provide a label for prefill dropdowns as we won't fetch all of the pages of choices until the user opens the dropdown:

```js theme={null}

https://api.zapier.com/v1/embed/trello/create/113
    ?steps[1][params][board]=1234
    &steps[1][meta][parammap][board]=Test
```

* `template=113`
* `steps[1][params][board]=1234`
* `steps[1][meta][parammap][board]=Test`

<Frame caption="Zap Editor showing `Test` pre-filled into the board field of a new Zap titled Create Card in Trello">
  <img src="https://cdn.zappy.app/ecadae9e61631a7cb1a456b581ab4705.png" />
</Frame>
