# Format when passing an argument to motoko function

**URL:** <https://forum.dfinity.org/t/format-when-passing-an-argument-to-motoko-function/6549>\
**Category:** Developers\
**Created:** [August 18, 2021, 1:09am UTC](https://forum.dfinity.org/t/format-when-passing-an-argument-to-motoko-function/6549 "2021-08-18T01:09:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [August 18, 2021, 5:49am UTC](https://forum.dfinity.org/t/format-when-passing-an-argument-to-motoko-function/6549/2 "2021-08-18T05:49:21Z")

</div>

> [@Franco-yvr](#):
>
> metadata : ?Blob;

Have you try to provide an empty array for the optional value?

```auto
api.mintNFT( {“to”: {“address” : “123456789123456789”, metadata: [] } } ).

```

According my tests and discussed [here](https://forum.dfinity.org/t/incorrect-optional-typescript-declaration-generation/6045), I think that optional values becomes mandatory array values on the frontend side.

If still doesn’t work, if you wrap your code with a try catch you do not get any errors in the console of the browser?

```auto
try {
   api.mintNFT(.....
} catch (err) {
   console.error(err);
}

```

---

_[View the full topic](https://forum.dfinity.org/t/format-when-passing-an-argument-to-motoko-function/6549)._
