Global Variable in WHERE clause with FORM app causes error

If you use a Global Variable in the WHERE clause of a Form App (any type except single row) you will get the below error. [TABLE=“border: 1”]
[TR]
[TD][SIZE=4]The following global variables are missing: [/SIZE] id[/TD]
[/TR]
[/TABLE]

You can try initializing the Global Variable in any of the statements it still gives the error

An example:
Assuming the table has x2 fields, id and name
In the WHERE clause of the SQL statement if you put in id=’[id]’
You will get the above shown error

Where did you declare the global variable, is it of type input or output?