Skip to main content
Solved

Get Connected Cards from a Known Pipe

  • September 29, 2022
  • 5 replies
  • 392 views

Keto-Faster
Forum|alt.badge.img+1

Background:

  • We have cards from Pipe A that have connected fields pointing to Pipe B (cards)
  • We need to find all connected cards for Pipe A from lookups for Pipe B

Which Would be Best Method To Do This

I am looking at this GraphQL API approach as the possible best route.

https://api-docs.pipefy.com/reference/objects/CardRelationship/

Using a search via Pipe ID (Pipe A’s ID) would this retrieve a list of all cards that are connected to Pipe B?

New to GraphQL so may be misunderstanding this/ there may be a much better approach/ simpler.

Best answer by marcos.pedrosa

Hello there, @Keto-Faster!
Hope you’re doing alright. 

I believe the following query will assist you with this matter:

 

query{
  allCards(pipeId:XXXXXXX){
    edges{
      node{
        id
        child_relations{
          name
          cards{
            id
            title
            fields{
              date_value
              datetime_value
              filled_at
              float_value
              indexName
              name
              report_value
              updated_at
              value
            }
          }
        }
      }
    }
  }
}

Hope this helps 😀

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

5 replies

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

Hello there, @Keto-Faster!
Hope you’re doing alright. 

I believe the following query will assist you with this matter:

 

query{
  allCards(pipeId:XXXXXXX){
    edges{
      node{
        id
        child_relations{
          name
          cards{
            id
            title
            fields{
              date_value
              datetime_value
              filled_at
              float_value
              indexName
              name
              report_value
              updated_at
              value
            }
          }
        }
      }
    }
  }
}

Hope this helps 😀


Forum|alt.badge.img+11

Hi, I’m not sure if this is exactly what you want but I did this query and it showed me the connections of a card

If you want one specific you can change child_relations to child_relations(child_repo_id: xxx)


{
  card(id: xxx) {
    id
    title
    pipe {
      name
    }
    child_relations {
      repo
      name
      cards {
        id
        title
      }
    }
  }
}
 


Keto-Faster
Forum|alt.badge.img+1
  • Author
  • New Member
  • 54 replies
  • September 29, 2022

@marcos.pedrosa thanks for the input.

 

  1. This works well for querying the Pipe A that has the connected field to see Pipe B connected cards via those connected Fields.
  2. However, when I query Pipe B it shows no connected cards. This is because Pipe B doesn’t have the connected fields, it is Pipe A that has them.

So the question: Is it possible to reverse this query so that it works for Pipe B - to find all parent cards from specific Pipes?


marcos.pedrosa
Pipefy Staff
Forum|alt.badge.img+2


@Keto-Faster 

If you want to reverse the query, you can do so, but you’ll need to change the child_relations to   parent_relations argument, when running the query in the Pipe B. 

Hope this helps you :) 

 

 

 


Keto-Faster
Forum|alt.badge.img+1
  • Author
  • New Member
  • 54 replies
  • September 30, 2022

@marcos.pedrosa yes, thanks - that solved it. Perfect.


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