# Why do I need to indent so much when constructing (not creating) a contract?

**URL:** <https://forum.canton.network/t/why-do-i-need-to-indent-so-much-when-constructing-not-creating-a-contract/715>\
**Category:** App Development\
**Tags:** daml\
**Created:** [June 23, 2020, 9:08am UTC](https://forum.canton.network/t/why-do-i-need-to-indent-so-much-when-constructing-not-creating-a-contract/715 "2020-06-23T09:08:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamirTalwar](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/samirtalwar/32/374_2.png) [@SamirTalwar](https://forum.canton.network/u/SamirTalwar)\
**Post date:** [June 23, 2020, 9:08am UTC](https://forum.canton.network/t/why-do-i-need-to-indent-so-much-when-constructing-not-creating-a-contract/715/1 "2020-06-23T09:08:13Z")

</div>

**Mod note: As of SDK 1.5.0 Scenarios have been superseded by the more powerful [Daml Script](https://docs.daml.com/daml-script/index.html). We now recommend using that for all purposes. [For more information, and to learn how to use Script please check out @Andreas’ post on our blog](https://daml.com/blog/engineering/daml-script-scenarios-2-0/).**

I seem to need at least 5 spaces when indenting a `with` block in constructing a contract.

For example:

```haskell
template Person
  with
    owner : Party
    name : Text
    dateOfBirth : Date
  where
    signatory owner

test = scenario do
  alice <- getParty "Alice"
  let person = Person with
        owner = alice
        name = "Alice"
        dateOfBirth = date 2020 Jan 1

  person.name === "Alice"

```

If I dedent the `with` block, so it looks like this:

```haskell
  let person = Person with
      owner = alice
      name = "Alice"
      dateOfBirth = date 2020 Jan 1

```

Then I get the following error:

```haskell
    • Constructor ‘Person’ does not have the required strict field(s): owner,
                                                                       name, dateOfBirth
    • In the expression: Person {}
      In an equation for ‘person’: person = Person {}

```

It appears as if the parser is recognizing nothing inside the `with` block.

If I go down to 2 spaces, I get an error on the first `=`:

```haskell
    parse error on input ‘=’

```

Why do I need so much whitespace?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [June 23, 2020, 9:12am UTC](https://forum.canton.network/t/why-do-i-need-to-indent-so-much-when-constructing-not-creating-a-contract/715/2 "2020-06-23T09:12:54Z")

</div>

You need to indent further than the name of the variable you are defining in your `let`. In

```haskell
let person = Person with
    owner = alice

```

you are defining 2 let-bindings, `person` is bound to `Person with` (so no fields which is why you are getting the error) and `owner` is bound to `alice`.

---

<div class="post-metadata">

**Author:** ![SamirTalwar](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/samirtalwar/32/374_2.png) [@SamirTalwar](https://forum.canton.network/u/SamirTalwar)\
**Post date:** [June 23, 2020, 9:14am UTC](https://forum.canton.network/t/why-do-i-need-to-indent-so-much-when-constructing-not-creating-a-contract/715/3 "2020-06-23T09:14:38Z")

</div>

Thanks @cocreature! I didn’t realize I could define multiple values in a single `let`.
