Skip to main content
Solved

Syntax help using a variable in a formula query

  • March 31, 2026
  • 0 replies
  • 82 views

Forum|alt.badge.img+2
  • Quickbase Alumni

Hello, i want to update my filter query to use a variable for the column number.

var text vRef = [ReferenceID];
var text QUERY = "{7.EX.'5'}";

vRef is my column number, what is the right way to replace the 7 in my query with vRef?

I've tried changing my ReferenceID column to both text and numeric, and have changed vRef to match, but neither seems to work. 

var number vRef = [ReferenceID];
var text QUERY = "{vRef.EX.'5'}";

 

Best answer by frac

thanks for the replay,  its not the second part of the query that i want to swap, it was the numeric column field.  i did some digging and it looks like while i cant seed a variable for the column number into the beginning of the query, i can just make the entire query string a variable and fed that in.  so i made another column with a formula query that updates of the referencde, and then i am pulling that whole thing in instead. 

var text vQuery = [Query];
var text QUERY = $vQuery;

 

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • March 31, 2026

trry this

Here is an example

var text QUERY = "{7.EX.'" & [ReferenceID] & "'}"

I always get tripped up by those single quotes.  I find that if the data in the field. [ReferenceID] was pure alphanumeric with no spaces or no unusual special characters that you don't need the single quotes, but they never hurt.