Solved

Filter phases by name in Pipefy

  • 7 August 2020
  • 3 replies
  • 677 views

Userlevel 4

Hello everyone. How can i filter phases by name? 
I don't know either. Here's what I'm trying:{
 allCards(pipeId: 123, filter: {field: "current_phase", operator: equal, value: "456"}) {
   edges {
     node {
       id
       title
       current_phase {
         id
       }
     }
   }
 }
}
But it says: Something went wrong :-(Any help would be much appreciated.

icon

Best answer by Marcos Carvalho 11 August 2020, 15:51

View original

3 replies

Userlevel 6
Badge +6

Hi there! Currently, our API only supports searching by the card's title, label, assignee, or when it was last updated. Here's an example of a search that involves the first three mentioned: 

 

{
cards(pipe_id: 1, search: {assignee_ids: [1, 2, 3], label_ids: [4, 5, 6], title: "abc"}) {
edges {
node {
id
}
}
}
}

 

And here's a query that filters a card based the date it was last updated: 

 

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

 

 

Userlevel 3

Funny. I was precisely looking for this. How to use the allCards function to filter cards by currentPhase, and retrieve all that are under a named phase. Is this not something most users would want to be able to do?

Userlevel 6
Badge +5

Hi there @Grafeno!

Unfortunately we don’t have that specific filter available natively on the allCards query. You’d need to create a script using a programming language and within the script you can input the nodes (card objects) that attend your code parameters (if current_phase = 123) into an array. If you’d like some boiler-plate code to get started, you can check out this page, which has a playground that helps you with the minimum code in some languages (
https://developers.pipefy.com/reference/graphql-endpoint

Reply