Skip to main content
October 18, 2023
Solved

How to pass multiple Query Parameter values to a GET web api?

  • October 18, 2023
  • 11 replies
  • 0 views

Tried passing multiple values to a query param to filter a column values that are in the list of values in query param.

In Query Filter tried the "in" operator. Its not working. Below is sample query param with multiple filters to filter by that I am trying.

?queryParam=value1,value2

Please advise how to filter based on multiple values.

Best answer by stefanhelzle0001

So you pass a string like "{1,2,3}" into a queryFilter using the "in" operator. What data type is that rule input?

I suggest to parse the string into a list of integers before passing it into the query.

a!localVariables(
  local!input: "{1,2,3}",
  tointeger(split(extract(local!input, "{", "}"), ","))
)

11 replies

stefanhelzle0001
October 18, 2023

We need more context here. Is this about one of these cases:

- a queryFilter for queryRecordType

- about a third party API that you want to pass values to

- or about an API that you create and you want to get values passed?

And try to explain this like to a three year old.

October 18, 2023

we have 2 Appian application and get value though web api call. 

One application require, all records from other application by passing multiple Ids as query parameter.

passing multiple value is not working, for single ids working fine.

stefanhelzle0001
October 18, 2023

I feel like a 120 years old caveman !?!?!?

I try to translate this into something usable.

- I want to create a GET API in Appian that accepts multiple comma-separated IDs in a single query parameter

- I need to query a list of records for which the primary key matches the passed IDs

- I then want to return the fetched record data in JSON format

Is that correct? If no, please elaborate.

And I need to see your implementation!