Solved

Get data from connection fields through API

  • 30 July 2020
  • 2 replies
  • 434 views

Userlevel 1
Badge

I built a python code to connect Pipefy to PowerBI, and achieved the result of a general exported report through a cards query, gathering all field data. But, connection fields only return their title in a similar fashion to “[connected_card_title]”.

 

Searching the API documentation I found reference to:

CardField values information, connectedRepoItems query
​​​​​​

Which I thought would be the solution to gather connected field data. Still, it only added to the field object the following:

{'connectedRepoItems': [{}], 'name': '...', 'value': '...'}

It can identify, correctly, which fields are connections, returning  [{}], and which fields aren’t returning ‘None’.

 

However, there is no information attached that could lead me to the connected card or register data.

 

Is there a way to directly gather data from a connected field, or will I need to pull data from all pipefy sources and compare titles to achieve it?

 

The problem of the latter is pipe connections where it’s possible to have cards with the same title and the added efficiency cost.

 

TL;DR Is there a query method that returns connected field data?

icon

Best answer by lais_lot 3 August 2020, 18:38

View original

2 replies

Userlevel 4

Hey @Nithael Sampaio  , how are you doing today?

You can use the query below:

 

{
  cards(pipe_id:1234567){
    edges{
      node{
        child_relations{
          cards{
            title
            id
            fields{
              value
              name
            }
          }
          name
          id
        }
      }
    }
  }
}

If you want to know about the parents just change the "child_relations" to "parent_relations" :)

Hope it helps. If you have any questions, let me know!

Userlevel 1
Badge

Thank you very much @lais_lot , it works :grin:

Reply