Skip to main content
Solved

How to get all cards from phase?


karmendes

How to get all cards from phase? And if the phase has more 50 cards, what i have to do?

Best answer by marcos.pedrosa

Hello Renato and team, 
in order to show all cards form a phase, you can use the query below:

query{
  phase(id:XXXXXX){
    cards{
      edges{
        node{
          id
          title
        }
      }
    }
  }
}

The current limit of cards/records shown is 30 cards per phase and 50 cards per pipe. Since our  API has pagination in place, you’ll need to use the following example in order to list all the cards.

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

You will set thepageInfo attribute and it will return the "endcursor", with the endcursor you can see the other cards within that phase, putting it as an argument in the "after" command. Example:
 

{
allCards(pipeId:123456, first:50, after:"WyIyLjI1IiwiMTg1LjAiLDI2ODc1OTNd"){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
}
}
}
}

Hope that helps 😃

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

11 replies

rafael.jefte
Forum|alt.badge.img+6

Hello how are you? Do you want to move all these cards? If so, you can create an automation to move all those cards to the next stage. If you don't know how to create an automation, take a look at this article:
https://help.pipefy.com/pt-BR/articles/3675228-como-crio-uma-automacao-para-mover-cards


karmendes
  • Author
  • Regular Participant
  • 3 replies
  • October 15, 2021

Hello Rafel,

I didn't explain it correctly, I'd like to get all the info for the cards of a specific phase through the api.

tsartori
Forum|alt.badge.img+4
  • Superuser
  • 157 replies
  • October 15, 2021

Hello @karmendes if the pipe have more than 50 cards tou should add the request pageInfo to the query, so answer will send a code that you could add as a param(after: ) to the request to start from there.

Ex: 

{
  allCards(pipeId:**********) {
    edges {
      node {
        id
      }
    }
  pageInfo {
    endCursor
    startCursor
  }}

}

Than:

{
  allCards(pipeId:*********, after:"abcde") {
    edges {
      node {
        id
      }
    }
  pageInfo {
    endCursor
    startCursor
  }}

}

 


Juliana Spinardi
Pipefy Staff
Forum|alt.badge.img+8

@karmendes did you get the answer you needed?


karmendes
  • Author
  • Regular Participant
  • 3 replies
  • October 18, 2021

Not Exactly, but i have other problem now.


tsartori
Forum|alt.badge.img+4
  • Superuser
  • 157 replies
  • October 18, 2021
karmendes wrote:

Not Exactly, but i have other problem now.

How can i help you?


karmendes
  • Author
  • Regular Participant
  • 3 replies
  • October 18, 2021

I am searching for all cards from specific phase from pipe, but my call to api when i pass pageInfo(endCursor) i have a error.

query
payload_test = {"query": "{phase(id:xxxxx,after:'xxx'){name cards_count cards {edges {node {age}}pageInfo {endCursor hasNextPage}}}}"}

I receive
{'errors': [{'message': 'Parse error on "\'" (error) at [1, 27]', 'locations': [{'line': 1, 'column': 27}]}]}


tsartori
Forum|alt.badge.img+4
  • Superuser
  • 157 replies
  • October 18, 2021
karmendes wrote:

I am searching for all cards from specific phase from pipe, but my call to api when i pass pageInfo(endCursor) i have a error.

query
payload_test = {"query": "{phase(id:xxxxx,after:'xxx'){name cards_count cards {edges {node {age}}pageInfo {endCursor hasNextPage}}}}"}

I receive
{'errors': [{'message': 'Parse error on "\'" (error) at [1, 27]', 'locations': [{'line': 1, 'column': 27}]}]}

Maybe its beacuse you dont need this text at the start, you can run the query from the {phase...


tsartori
Forum|alt.badge.img+4
  • Superuser
  • 157 replies
  • October 18, 2021
tsartori wrote:
karmendes wrote:

I am searching for all cards from specific phase from pipe, but my call to api when i pass pageInfo(endCursor) i have a error.

query
payload_test = {"query": "{phase(id:xxxxx,after:'xxx'){name cards_count cards {edges {node {age}}pageInfo {endCursor hasNextPage}}}}"}

I receive
{'errors': [{'message': 'Parse error on "\'" (error) at [1, 27]', 'locations': [{'line': 1, 'column': 27}]}]}

Maybe its beacuse you dont need this text at the start, you can run the query from the {phase...

Like this 

 


  • New Member
  • 1 reply
  • September 23, 2022

I’m stuck on same problem.

I tried to get all cards from one unique phase and it doesn’t return all of them.

Using the code below I’ll need to request every single card to get its phase information, then I will be able to use them.

"""{
  allCards(pipeId: xxxx) {
    edges {
      node {
        id
      }
    }
  pageInfo {
    endCursor
    startCursor
  }}}"""

I tried to get all cards using “phaseId”, “pipeId, phaseId“ but it’s not a valid argument, tried getting pageInfo on code below and doesn’t work too.

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

I need to get absolutelly all cards from a single phase, the most efficient way (it’s ok to make a request for each 30 cards, but with the information I can get from here and the documentation it looks like I’ll need to make a request to each card to get it phase). 


marcos.pedrosa
Pipefy Staff
Forum|alt.badge.img+2
  • Pipefy Staff
  • 41 replies
  • Answer
  • September 26, 2022

Hello Renato and team, 
in order to show all cards form a phase, you can use the query below:

query{
  phase(id:XXXXXX){
    cards{
      edges{
        node{
          id
          title
        }
      }
    }
  }
}

The current limit of cards/records shown is 30 cards per phase and 50 cards per pipe. Since our  API has pagination in place, you’ll need to use the following example in order to list all the cards.

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

You will set thepageInfo attribute and it will return the "endcursor", with the endcursor you can see the other cards within that phase, putting it as an argument in the "after" command. Example:
 

{
allCards(pipeId:123456, first:50, after:"WyIyLjI1IiwiMTg1LjAiLDI2ODc1OTNd"){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
}
}
}
}

Hope that helps 😃


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