Skip to main content
Solved

Get the late cards from a sprecific pipe using GraphQL


contato1705
Forum|alt.badge.img

Hey everyone! I’m trying to get all the late cards from a specific pipe. At the moment, i’m using this code here, that gives me all the cards from the pipe and then, on my editor, i filter the late ones:

{allCards(pipeId: XXXXXXXX, first: 50) 
  {pageInfo {
    hasNextPage
    endCursor
  }
    edges {
      node {
        id
        late
        current_phase{
          id}
      }
    }
  }
}

 

Is there a way that i can get only the late cards? Like a request that only returns the late cards, an their respectives id and current phase?

Best answer by marcosmelo

contato1705 wrote:

Hey everyone! I’m trying to get all the late cards from a specific pipe. At the moment, i’m using this code here, that gives me all the cards from the pipe and then, on my editor, i filter the late ones:

{allCards(pipeId: XXXXXXXX, first: 50) 
  {pageInfo {
    hasNextPage
    endCursor
  }
    edges {
      node {
        id
        late
        current_phase{
          id}
      }
    }
  }
}

 

Is there a way that i can get only the late cards? Like a request that only returns the late cards, an their respectives id and current phase?



Hello, @contato1705 

The following code fetches the specified phase and returns only late cards

Check if its helps

 

{

    phase(id: "xxxxxxxxxx") {
    name
    cards {
        edges {
          node {
            id
            title
            late
           
            }
          
            }
          }
        }
      }
    

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

6 replies

marcosmelo
Forum|alt.badge.img+18
  • Pipefy Legend
  • 1465 replies
  • Answer
  • March 13, 2023
contato1705 wrote:

Hey everyone! I’m trying to get all the late cards from a specific pipe. At the moment, i’m using this code here, that gives me all the cards from the pipe and then, on my editor, i filter the late ones:

{allCards(pipeId: XXXXXXXX, first: 50) 
  {pageInfo {
    hasNextPage
    endCursor
  }
    edges {
      node {
        id
        late
        current_phase{
          id}
      }
    }
  }
}

 

Is there a way that i can get only the late cards? Like a request that only returns the late cards, an their respectives id and current phase?



Hello, @contato1705 

The following code fetches the specified phase and returns only late cards

Check if its helps

 

{

    phase(id: "xxxxxxxxxx") {
    name
    cards {
        edges {
          node {
            id
            title
            late
           
            }
          
            }
          }
        }
      }
    


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • March 14, 2023

The answer by @marcosmelo does not do what you want, @contato1705 . It only lists the cards of a specific phase, without limit on whether they are late or not.

What should be possible instead is to use the https://api-docs.pipefy.com/reference/queries/#allCards allCards query with the filter, where you filter for the date.

I currently do not have the necessary tools available, but I will add another answer later with the actual query I would suggest.


marcosmelo
Forum|alt.badge.img+18
  • Pipefy Legend
  • 1465 replies
  • March 14, 2023

Thanks for contributing, @genietim !


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • March 14, 2023

As promised, here an example query using the advanced search to query to the due date:

 

query {
    allCards(pipeId: <yourPipeId>, filter: {
        field: "due_date",
        operator: lte,
        value: "2023-03-14T00:00:00-02:00"
    }) {
        edges {
            node {
                id title late
                fields {
                    name
                    value
                }
            }
        }
    }
}

 

that should solve your problem, no?


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • March 14, 2023

(thank you too, @marcosmelo , sorry if my answer was a bit too dismissive as I realise now, and sorry if I understood something wrong anyway)


marcosmelo
Forum|alt.badge.img+18
  • Pipefy Legend
  • 1465 replies
  • March 14, 2023

Don't worry, @genietim

Tks!!


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