# Is it possible to use Grid Variable for Connection Option in API Query?

**URL:** <https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642>\
**Category:** Matillion ETL\
**Created:** [February 4, 2022, 6:51am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642 "2022-02-04T06:51:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ryan](https://matillioncommunity.discourse.group/u/ryan)\
**Post date:** [February 4, 2022, 6:51am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642/1 "2022-02-04T06:51:16Z")

</div>

Has there been anyone who is able to use Grid Variable to Iterate the URI parameter?

&nbsp;

When setting it up originally, it requires to add the parameter = Value (shown below)

&nbsp;

 ![0694G00000J5gX0QAJ_0D54G00008DaG1QSAV](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/488ff0a33c408c7b748f52a7fadaa73fa3f0f9d8.png)

But when the grid variables are used, it produces an error because the value in the URI Connection is just the value (ex. 100000 instead of event\_id=100000)

How can I add the parameter to the grid variable value to make this work?

&nbsp;

![0694G00000J5gWlQAJ_0D54G00008DaG1QSAV](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/optimized/1X/24a3d42cb7a3f2bd0ebf3998ea101aceafa3592c_2_690x37.png)

&nbsp;

Thanks,

Ryan

---

<div class="post-metadata">

**Author:** ![NeelamMacwan](https://avatars.discourse-cdn.com/v4/letter/n/8baadc/32.png) [@NeelamMacwan](https://matillioncommunity.discourse.group/u/NeelamMacwan)\
**Post date:** [February 4, 2022, 11:56am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642/2 "2022-02-04T11:56:58Z")

</div>

Hi Ryan,

&nbsp;

I am not sure if this is the answer but you need to provide connection details in the 'Connection Options' like API key value. Please check the screenshot for this:

And the details should be passed in the API Query Component also. The value of grid variable should be passed when you declared it.

Hope this works for you.

![0694G00000J5iUwQAJ_0D74G000007kZheSAE](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/optimized/1X/8283a1d7f0985ce3f2f292117e624749427d01f3_2_690x38.png)

&nbsp;

Thanks,

Neelam

---

<div class="post-metadata">

**Author:** ![ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ryan](https://matillioncommunity.discourse.group/u/ryan)\
**Post date:** [February 7, 2022, 2:02am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642/3 "2022-02-07T02:02:48Z")

</div>

This is really helpful.

I've been able to make it work by leveraging the advanced settings and using the variable in the SQL query.

&nbsp;

Thank you so much for the help!

---

<div class="post-metadata">

**Author:** ![SB699925](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/sb699925/32/1180_2.png) [@SB699925](https://matillioncommunity.discourse.group/u/SB699925)\
**Post date:** [February 28, 2022, 5:26am UTC](https://matillioncommunity.discourse.group/t/is-it-possible-to-use-grid-variable-for-connection-option-in-api-query/1642/4 "2022-02-28T05:26:44Z")

</div>

Hey [@ryan](https://matillioncommunity.discourse.group/u/ryan)​ any chance you could share some pseudo-code for your solution? I'm also trying to get a job variable passed into the URI but no luck so far... cheers!
