# DAML script createCmd syntax

**URL:** <https://forum.canton.network/t/daml-script-createcmd-syntax/986>\
**Category:** App Development\
**Created:** [August 5, 2020, 11:47am UTC](https://forum.canton.network/t/daml-script-createcmd-syntax/986 "2020-08-05T11:47:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_m](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/alex_m/32/550_2.png) [@alex\_m](https://forum.canton.network/u/alex_m)\
**Post date:** [August 5, 2020, 11:47am UTC](https://forum.canton.network/t/daml-script-createcmd-syntax/986/1 "2020-08-05T11:47:23Z")

</div>

Hello,

I am trying to write an initialisation script for my app.

I have something like:

```
submit alice do createCmd Product with 
    isProcessed = False
    description = "Coffee for Starbucks"
    owner = alice
    ...

```

I am getting an error (highlighted underneath the first ‘=’). This goes away if I assign all on one line and with semicolons:

`submit alice do createCmd Product with isProcessed = False; description = "Coffee for Starbucks"; owner = alice;`

This is not ideal because the `Product` has many fields. How can I assign on newlines?

Thanks again!

N.B: Error also arises with newlines + semicolons

---

<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:** [August 5, 2020, 12:25pm UTC](https://forum.canton.network/t/daml-script-createcmd-syntax/986/2 "2020-08-05T12:25:48Z")

</div>

DAML is indentation sensitive. When you start a new block via `do`, `with`, … you have to align nested blocks further than the previous block. In this case the block started by the `do` is aligned at the start of `createCmd` so the block started by `with` needs to be indented further.  
Here is an example that works:

```haskell
  submit alice do createCmd Product with
                   isProcessed = False
                   description = "Coffee for Starbucks"
                   owner = alice

```

You are free to indent the block even further.  
What you can do as well which I would personally do here is to insert a line break after the `do` so that `createCmd` can move a bit further to the left. Here’s an example:

```haskell
  submit alice do
    createCmd Product with
      isProcessed = False
      description = "Coffee for Starbucks"
      owner = alice

```

---

<div class="post-metadata">

**Author:** ![alex\_m](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/alex_m/32/550_2.png) [@alex\_m](https://forum.canton.network/u/alex_m)\
**Post date:** [August 5, 2020, 1:22pm UTC](https://forum.canton.network/t/daml-script-createcmd-syntax/986/3 "2020-08-05T13:22:38Z")

</div>

Oh, dunno why I didn’t do that! Cheers
