data/v1 endpoint - Filter on columns and values with spaces in their names

Is it possible to filter results on the data/v1 endpoint with columns or values that have spaces in their names? I've tried every combination imaginable to get results for a column named Spend Category, but continuously get this 400 error. Filtering results with columns and values that don't have spaces works as expected. Documentation I've been referencing has no insight re: handling spacing. Tried %20 escape, backticks, underscores, hyphens, etc, etc, etc.

"Bad Request","message":"DA0012: A filter was provided to filter the data but it contains a grammatical error or is otherwise invalid and it could not be parsed. The offending filter is: Spend Category = redacted. The parsing error is: expression values cannot be parsed at Spend Category = redacted.

Request looks like below.

const where = ['Spend Category = REDACTED'];

//Get the data
var query = `/data/v1/${datasets[0]}?fields=${fields.join()}&filter=${where.join()}`;

https://developer.domo.com/docs/dev-studio-references/data-api

Documentation being used:

Tagged:

Answers

  • Do you have a fields variable defined in your code prior to this segment?

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • dp12345
    dp12345 Member

    @GrantSmith I do. The code runs properly if the where claus contains words without spaces (e.g. test = test). The issue is only with the where clause having columns and values that have spaces in them.

    Strange thing is the same column (Spend Category) is in the fields variable and that part of the request works fine as mentioned.

  • I'm having this exact same problem. The field with a space is listed as a field and that works fine. When I list the field as a groupby I get an error:

    DA0057: An alias list was provided but it could not be parsed.