Not able to access variable from JS query to the REST api query

Referring to this post implemented the same logic, but the parameter is not accessible in transformer6. @stefancvrkotic