# Creating contract from script data

**URL:** <https://forum.canton.network/t/creating-contract-from-script-data/6678>\
**Category:** App Development\
**Created:** [June 15, 2023, 11:08am UTC](https://forum.canton.network/t/creating-contract-from-script-data/6678 "2023-06-15T11:08:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joy\_K](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/joy_k/32/6616_2.png) [@Joy\_K](https://forum.canton.network/u/Joy_K)\
**Post date:** [June 15, 2023, 11:08am UTC](https://forum.canton.network/t/creating-contract-from-script-data/6678/1 "2023-06-15T11:08:38Z")

</div>

Hi… suppose if we have a some contract and we have written script for that contract also with some mock data .is it is possible that script will work like bootstrap script that whenever Daml will start it will create contract on the ledger with that script data and we can check those contracts on Navigator. Please try to explain with some example.

---

<div class="post-metadata">

**Author:** ![solomonchauda](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/solomonchauda/32/4715_2.png) [@solomonchauda](https://forum.canton.network/u/solomonchauda)\
**Post date:** [June 16, 2023, 5:24am UTC](https://forum.canton.network/t/creating-contract-from-script-data/6678/2 "2023-06-16T05:24:15Z")

</div>

Hello @Joy_K

Yes, this is possible. To run a daml script on startup, you may include it in your daml.yaml file. Within your daml.yaml file, you can add an option, “init-script”, that will run your specified daml script on startup.

For example, if I had a script named ‘createToken’, residing in the path /Scripts/Token.daml, I would add the following into the daml.yaml file:  
init-script: Scripts.Token:createToken

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Joy\_K](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/joy_k/32/6616_2.png) [@Joy\_K](https://forum.canton.network/u/Joy_K)\
**Post date:** [June 16, 2023, 6:21am UTC](https://forum.canton.network/t/creating-contract-from-script-data/6678/3 "2023-06-16T06:21:42Z")

</div>

Thank you so much …it worked! 😀

---

<div class="post-metadata">

**Author:** ![Ianw1](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ianw1/32/7172_2.png) [@Ianw1](https://forum.canton.network/u/Ianw1)\
**Post date:** [June 16, 2023, 10:39am UTC](https://forum.canton.network/t/creating-contract-from-script-data/6678/4 "2023-06-16T10:39:55Z")

</div>

You can also use the `daml script` command to run a script on an existing ledger.
