# How to pass array with fcl.arg() in a transaction?

**URL:** https://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104
**Category:** Uncategorized
**Created:** [May 13, 2022, 11:51am UTC](https://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104 "2022-05-13T11:51:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sylv1un](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sylv1un](https://forum.flow.com/u/sylv1un)
#### Post date: [May 13, 2022, 11:51am UTC](https://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104/1 "2022-05-13T11:51:09Z")

</div>

Hi,

I use reactjs and I have a problem with a transaction. I don’t understand why I can’t pass an Array with fcl.  
This is my code :

```
const tx = await fcl
                .send([
                    fcl.proposer(fcl.authz),
                    fcl.payer(fcl.authz),
                    fcl.authorizations([fcl.authz]),
                    fcl.limit(9999),
                    fcl.args([
                        fcl.arg(props.nftsToSell, t.Array(t.UInt64)), 
                        fcl.arg(prix.toFixed(2), t.UFix64),
                    ]),
                    fcl.ref(block.id),
                    fcl.transaction(sellSelection),
                ]);

```

On the first argument “props.nftsToSell” is an array of integers that contains the ids of two nfts to sell, like this [182,183]. I used parseInt() to get these integers in the array (I read on a forum that by default parseInt() cast in UInt64)  
But when I run that, I get this error:

```
    Error: Type Error: Expected integer for UInt64
    at f (types.js:16:1)
    at Object.asArgument (types.js:137:1)
    at types.js:411:1
    at Array.map (<anonymous>)
    at Object.asArgument (types.js:410:1)
    at Dn (resolve-arguments.js:10:1)
    at Un (resolve-arguments.js:20:1)
    at interaction.js:244:1

```

Can you help me please to understand my error ?

Thanks you very much for your help 🙂

---

<div class="post-metadata">

### Author: ![NasirAliShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/nasiralishah/32/519_2.png) [@NasirAliShah](https://forum.flow.com/u/NasirAliShah)
#### Post date: [May 13, 2022, 12:05pm UTC](https://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104/2 "2022-05-13T12:05:27Z")

</div>

Hi, @sylv1un I think so there must be some problem with your data type. here is the react code

```auto
const passArray = async () => {
    let array = [1, 2]
    const transactionId = await fcl.send([
      fcl.transaction`
      transaction(nftTosel:[UInt64]) {
        prepare(signer: AuthAccount) {

        }
      }
      `,
      fcl.payer(fcl.authz),
      fcl.proposer(fcl.authz),
      fcl.authorizations([fcl.authz]),
      fcl.limit(9999),
      fcl.args([
        fcl.arg(array, t.Array(t.UInt64))
      ])
    ]).then(fcl.decode);
    console.log(transactionId);
  }

```

and this is the transaction id in the testnet.  
[https://testnet.flowscan.org/transaction/39344b4f0f4ec6143f7352f0543cf66593f3d5afd2ae18bc19268e49702b908a/script](https://testnet.flowscan.org/transaction/39344b4f0f4ec6143f7352f0543cf66593f3d5afd2ae18bc19268e49702b908a/script)

---

<div class="post-metadata">

### Author: ![sylv1un](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sylv1un](https://forum.flow.com/u/sylv1un)
#### Post date: [May 13, 2022, 1:43pm UTC](https://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104/3 "2022-05-13T13:43:52Z")

</div>

Ohh Ok ! You are right !  
I had an array within an array in my “pops.nftsToSell” variable 🙃, like this:  
[[1, 2] ]

Thank you very much [NasirAliShah](http://forum.flow.com/t/how-to-pass-array-with-fcl-arg-in-a-transaction/3104/2) it is good for me 🙏 👌
