Can you use a variable within a LIKE query?

I’m using React, and I’m new to it. I want to have the items sort by last name (this works fine), and I want for the user to type into a search box the value of the variable query. This variable query will be used on the LIKE query.
const searchURL= 'HiddenUrlHERE/_table/FacultyInfo?order=facLastName%20ASC&filter=facLastname%20like%20%${query}%25`

When I look at the console, it says there’s no results returned.

This call is supposed to sort faculty by last name, then show the user faculty that match their search.
I tried looking up the syntax for LIKE, but I could only find how to use like for a set string. What is the URL I should type? Thanks.


You can definitely pass variables into your DreamFactory API queries. I’m by no means a React expert, but believe that because you’re using single quotes the variable will not interpolate. Instead you’ll want to use backticks to surround the searchURL variable. See this Stack Overflow post for more information: