# How can I send Global Variable as a Parameter in Webservice Request

**URL:** <https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722>\
**Category:** Miscellaneous\
**Tags:** katalon-studio\
**Created:** [June 2, 2017, 5:28am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722 "2017-06-02T05:28:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [June 2, 2017, 5:28am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/1 "2017-06-02T05:28:30Z")

</div>

I want to pass global variables as Webservice Parameter Key and Value. Is it possible?

---

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [June 7, 2017, 7:26am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/2 "2017-06-07T07:26:14Z")

</div>

Oh okay, is it part of your vision? would it be supported in next release?

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [June 7, 2017, 6:40am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/3 "2017-06-07T06:40:04Z")

</div>

So that is not possible because that’s not supported yet.

---

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [June 7, 2017, 6:35am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/4 "2017-06-07T06:35:50Z")

</div>

No, your code would be written in Testcase section. My scenario is to pass Key and Values (parameters) in ObjectRepository --\> Webservice Request --\> Post Request --\> Body Section.

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [June 2, 2017, 10:58am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/5 "2017-06-02T10:58:36Z")

</div>

Please refer to my solution on this topic: [http://forum.katalon.com/questions/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/](http://forum.katalon.com/questions/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/)

Your case should adjusted to:

`request.getRestParameters().add(new TestObjectProperty('Key', ConditionType.EQUALS, GlobalVariables.yourValue))`

---

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [June 2, 2017, 9:58am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/6 "2017-06-02T09:58:35Z")

</div>

Could anyone answer this please

---

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [June 2, 2017, 6:43am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/7 "2017-06-02T06:43:30Z")

</div>

Also how can I pass the Global variables values in Request ‘Body’ section?

Scenario: I need to capture the value from Web UI and store it in Global variable. And I need to pass that variable as a parameter in Webservice request as POST

---

<div class="post-metadata">

**Author:** ![Niro1](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Niro1](https://forum.katalon.com/u/Niro1)\
**Post date:** [January 25, 2018, 10:09am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/8 "2018-01-25T10:09:27Z")

</div>

Hey Guys,

Is the feature of passing Objects to POST request body section still not available?  
please confirm.

Thanks  
Niro

---

<div class="post-metadata">

**Author:** ![Valeriy](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Valeriy](https://forum.katalon.com/u/Valeriy)\
**Post date:** [September 18, 2018, 11:34am UTC](https://forum.katalon.com/t/how-can-i-send-global-variable-as-a-parameter-in-webservice-request/6722/9 "2018-09-18T11:34:20Z")

</div>

> Niro said:
> 
> Hey Guys,
> 
> Is the feature of passing Objects to POST request body section still not available?  
> please confirm.
> 
> Thanks  
> Niro

Yes I could do this that way:  
1. First, you should make a references in your json body section:  
For example your json was like this  
{“email”: “[mymail@mailserver.com](mailto:mymail@mailserver.com)”}  
you want to parametrize the value of email element.  
2. You should go to variable section and define here a variable like this  
Name = Login  
Value = [mymail@mailserver.com](mailto:mymail@mailserver.com)  
3. Then you shoul add refernces in your json-body in accordance with JSON spec  
{“email”: {“$ref”: “#Login”}}
