# Can I get API url from data files (Data driven approach)

**URL:** <https://forum.katalon.com/t/can-i-get-api-url-from-data-files-data-driven-approach/24100>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [April 29, 2019, 2:27pm UTC](https://forum.katalon.com/t/can-i-get-api-url-from-data-files-data-driven-approach/24100 "2019-04-29T14:27:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Igi\_PL](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/igi_pl/32/1083_2.png) [@Igi\_PL](https://forum.katalon.com/u/Igi_PL)\
**Post date:** [April 30, 2019, 4:02pm UTC](https://forum.katalon.com/t/can-i-get-api-url-from-data-files-data-driven-approach/24100/4 "2019-04-30T16:02:25Z")

</div>

Hi @angelo.dabu

My post can help: [How to use Global Variable directly in Object Repository URL](http://forum.katalon.com/t/how-to-use-global-variable-directly-in-object-repository-url/23635/2)

1. Add Global Variable in Profile (“G\_fileName”).
2. Add Local Variable (“file” - to match yours URL) in request definition (Object Repository) and set type “Global Variable”. Select Global Variable, created in 1. in Default Value. This will link Local with Global.
3. Loop in TC.

Code not tested, it is just idea:

```
import com.kms.katalon.core.testdata.TestDataFactory
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

myData = TestDataFactory.findTestData('listOfFiles')
myData.allData.forEach()
{
	GlobalVariable.G_fileName = it[1] //Yes you will get array
	res = WS.sendRequest(findTestObject('fileRequestName'))
	//Do what you need with res
}
```

---

_[View the full topic](https://forum.katalon.com/t/can-i-get-api-url-from-data-files-data-driven-approach/24100)._
