Skip to main content
Solved

How to findCards that have some value on a field and also are in a specific phase?


Inmo Tecnologia

Hi, I´m new here, and I need to find all cards that have that field value, but also just return the ones in a specif phase. How can I do that?

 

My query looks like that:  findCards(    pipeId: "301593112"    search: {fieldId: "placa", fieldValue: "HJD3B23"} )

 

 

Best answer by Lucas Democh

Hello @Inmo Tecnologia,

It is currently not possible to filter the phase in Pipefy queries.

A workaround is for you to create a field that will be updated with the phase name at each phase change.

So, you can add the filter to the content of this field with the name of the phase you want to filter.

 

A second, slightly more complex option is to use the Phases endpoint.

In this query, you inform the phase ID and get all the cards in the queried phase as a return.

You would have to do a treatment to be able to cross the two queries and filter only the cards that are in the two queries (Left Join).

 

The phase query can be done like this:

{
  phase(id: 12345){
    id
    name
    cards_count
    fields {
      id
      label
    }
    cards{
      edges{
        node{
          id
        }
      }
    }
  }
}

 

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

2 replies

Lucas Democh
Forum|alt.badge.img+15
  • Pipefy Legend
  • 396 replies
  • Answer
  • August 1, 2022

Hello @Inmo Tecnologia,

It is currently not possible to filter the phase in Pipefy queries.

A workaround is for you to create a field that will be updated with the phase name at each phase change.

So, you can add the filter to the content of this field with the name of the phase you want to filter.

 

A second, slightly more complex option is to use the Phases endpoint.

In this query, you inform the phase ID and get all the cards in the queried phase as a return.

You would have to do a treatment to be able to cross the two queries and filter only the cards that are in the two queries (Left Join).

 

The phase query can be done like this:

{
  phase(id: 12345){
    id
    name
    cards_count
    fields {
      id
      label
    }
    cards{
      edges{
        node{
          id
        }
      }
    }
  }
}

 


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • August 2, 2022

I agree with Lucas, either you introduce an auxilary field you search for, or you do the filtering manually in your code, either for the correct phase or the correct field value, whatever requires less cards to load.


Reply


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