Query on Returned Web API data

Hi,

Is there a way to query on a returned Web API Data. The requirement is that I can search thru the data using different filters. Passing of parameters to Web API is not possible as of the moment so what we can do is just loop thru each returned row and check if it matches the parameter.

My initial work around is that, from the returned data from Web API I managed to map each API field to Appian data. After that, to be able to filter there's a a loop that check it matches what is being queried.

Thanks in advance!

  Discussion posts and replies are publicly visible

  • Unless you're able to add parameters to the call, I think the only way to accomplish this is what you've implemented by filtering the returned data subset in Appian.
  • with(
    /*Run the "queryrecord()" function on "cons!DA_EMPLOYEE_RECORD" to retrieve data for the first 50 records and store this data in a local variable named "local!records".*/
    local!records: queryrecord(
    cons!DA_EMPLOYEE_RECORD,
    a!query(
    filter: if(
    isnull(http!request.queryParameters.department),
    null,
    a!queryFilter(field: "department",operator: "=",value: http!request.queryParameters.department)),
    pagingInfo: a!pagingInfo(startIndex: 1,batchSize: 50))
    ).data,

    /*Construct an HTTP response that contains the information that we just stored in "local!records".*/
    a!httpResponse(
    /*Set an HTTP header that tells the client that the body of the response will be JSON-encoded.*/
    headers: {a!httpHeader(name: "Content-Type", value: "application/json")},
    /*JSON-encode the value of "local!records" and place it in the response body.*/
    body: a!toJson(value: local!records)
    )
    )