Skip to main content
June 22, 2022
Solved

Filter the output through GET API

  • June 22, 2022
  • 7 replies
  • 0 views

i have a table of 6 fields . i am requesting the data with GET request so that i want to show only 3 fields from the table. How can i do that?

    Best answer by peter.lewis

    You should be able to add the "selection" parameter inside of your a!query() function to specify which fields should be returned. Try adding something like this:

    selection: {
      a!queryColumn(field: "field_one"),
      a!queryColumn(field: "field_two"),
      a!queryColumn(field: "field_three")
    }

    7 replies

    stefanhelzle0001
    Brainy
    June 22, 2022
    neilb2444Author
    June 22, 2022

    in the image there is .data.color. it is working fine because we are trying to return only single field. but if i want to return 2 or 3 fields what should i do?

    stefanhelzle0001
    Brainy
    June 22, 2022

    Add more fields to the fields parameter and reduce the last line to just ".data" to return a list of data structures.