How to return a single record with 2 or more parameters (inputs) having to be true? (GET)

Options

I see in the endpoint query maker tool the note "If you choose a field_value that maps to multiple records, then the first one found will be used." This would not work for my use case.

I have a table with multiple recrods containing the same field value. However I would like to know how to search by multiple field values (parameters) to return one record.

For instance, let's say there is a "Brandon" in the "Name" field with an income of "$100,000" for the "Income" field. Additionally, there is a 2nd "Brandon" in the "Name" field with an income of "$50,000". I would like to return the entire single record of the "Brandon" that has "$50,000" as "Income".

Putting it in pseudo code:

Return record where:

Field "Name" = "Brandon" AND && Field "Income" = "$50,000".

Currently I am only seeing this limited to one search parameter. How would I go about querying a table like the example above for a Get Request of a single record?

Thank you!

Best Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Answer ✓
    Options

    Hey @bcasmvrg — this is done with the Query All Records function. When you click on Query All Records > Filter > By Custom Query and can set WHERE statements based on how you want to return the records.

    Here's a quick example that should get you on your way:

    And a comprehensive overview of the Query All Records function:

  • bcasmvrg
    bcasmvrg Member
    Answer ✓
    Options

    Perfect, this worked exactly how I wanted it to. Now when I pass my params in my GET request along with those filters in place, I only get the 1 record I desired. Orignally, I was using GET RECORD on it's own as it seemed more intuitive for what I wanted - but I now understand the power in the QUERY ALL endpoint and its flexability. I would conisder this request resolved. Thank you!