Skip to main content
Solved

[GraphQL] Can I filter cards by custom field values?

  • January 4, 2021
  • 2 replies
  • 1259 views

brennomaeji

I’ve seen here (https://developers.pipefy.com/changelog/new-graphql-feature-query-cards-by-updated_at) that we can filter cards by using built-in field liks update_at.

 

How can I filter my cards by a custom field? Let’s say i have a field called “customer_id”. I tried this but didnt get it to work:

 

query allCardUpdatedYesterday { allCards(first: 20, pipeId: 123,filter: { field: "customer_id", operator: equal, value: "87y8-b7a6b-8a6c"}) { edges { node { id title } } } }

 

Do I have to prefix the field id with something?

 

The response I get does not add much:

 

{
  "data": {
    "allCards": null
  },
  "errors": [
    {
      "message": "Something went wrong",
      "locations": [
        {
          "line": 18,
          "column": 3
        }
      ],
      "path": [
        "allCards"
      ],
      "code": 30000,
      "type": "ExecutionError"
    }
  ]
}

Best answer by Marcos Carvalho

Hey @brennomaeji , 

 

Unfortunately it’s not possible to filter by fields in the allCards query. 

 

The only filter available is the updated_at filter, like this:

{
 allCards(pipeId: 576018, first:5 filter: {field: "updated_at", operator: gte, value: "2019-04-02T00:00:00-00:00" AND:[{field: "updated_at", operator: lte, value: "2019-04-03T00:00:00-00:00"}]}) {
   edges {
     node {
       id
       title
     }
   }
   pageInfo {
     hasNextPage
     endCursor
   }
 }
}

 

 

But if you want, the Cards query has more options: 

 



 

Hope it helps you :slight_smile:

View original
Did this topic help you find an answer to your question?

2 replies

Marcos Carvalho
Pipefy Staff
Forum|alt.badge.img+6

Hey @brennomaeji , 

 

Unfortunately it’s not possible to filter by fields in the allCards query. 

 

The only filter available is the updated_at filter, like this:

{
 allCards(pipeId: 576018, first:5 filter: {field: "updated_at", operator: gte, value: "2019-04-02T00:00:00-00:00" AND:[{field: "updated_at", operator: lte, value: "2019-04-03T00:00:00-00:00"}]}) {
   edges {
     node {
       id
       title
     }
   }
   pageInfo {
     hasNextPage
     endCursor
   }
 }
}

 

 

But if you want, the Cards query has more options: 

 



 

Hope it helps you :slight_smile:


tiago
  • Regular Participant
  • 2 replies
  • October 1, 2021

Concordo que seria incrível se pudéssemos filtrar por custom field

I agree it would be amazing if we could filter by custom field 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings