> For the complete documentation index, see [llms.txt](https://synoint.gitbook.io/survey-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://synoint.gitbook.io/survey-library/overview/passing-variables-to-url.md).

# Passing variables to URL

This code tutorial will let you know how to pass arguments direct to the URL.

One of the common case of use is, for example, when you are trying to set a variable at the beginning of the survey.&#x20;

Let's say that we need to set the variable COUNTRY to one option. You will need to copy the survey link and after that concatenate the survey question codes using the following format.

**`your_survey_url?q[COUNTRY]=`**[**`1`**](#user-content-fn-1)[^1]

your survey url is getting from the **Publish** tab on SynoSurvey. There you will see a menu with the survey links. You need to click tje right button and copy the link and select the option **copy link**. It works for both, **LIVE** and **TEST** urls. &#x20;

<figure><img src="https://3256950692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8ViByLqKSYWJoXIHUUnY%2Fuploads%2F1ezBiCCIRo21w15v9xDb%2Fimage.png?alt=media&amp;token=7238e902-4716-4e3d-9766-cfe5713194e2" alt=""><figcaption></figcaption></figure>

This will select the first option of a question whose id will be `COUNTRY`. In addition, you will need to copy this code into the page to hide the page and go to the next question.

```javascript
// Hide page and go to next question
document.querySelector("body").classList.add("d-none");
document.querySelector("#p_next").click();
```

[^1]: Answer option
