Current page URL for query

Do you mean a URL param for example

www.mysite.com/tables/records/MYPARAM

Where MYPARAM would be a variable that changes then check out this tutorial: