Skip to main content
Solved

Clear several Database records at once


gonzalo9

Hi People, 

We need to clear 2000 register of a database?, how i can do fast?

 

thanks

Best answer by Nicole Chiroli

Hey, @gonzalo9. Good morning :)

You can find them through the API as well like this:
{
  table_records(first: 30, table_id: "s5UuWo_N") {
    edges {
      node {
        id
        title
        }
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

It is important to stress that, if you are going to check it through API, we have pagination so you can see all cards within the phase. The current limit of cards/records shown is 30 cards per phase and 50 cards per pipe/db.


Pagination works like this; you will set the pageInfo 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:{
  phase(id: 6158453) {
    name
    cards (first:30 after: "WzQzODY0NDcwXQ==") {
      pageInfo{
        endCursor
        hasNextPage
      }
      edges {
        node {
          fields{
            value
            field{
              id
              label
            }
          }
          id
          title
          createdAt
          done


          pipe {
            id
            name
          }
          creatorEmail
          current_phase {
            id
            name
          }
        }
      }
    }
  }
}

 

You can also create an ID field and check from inside the database:
 


Hope it helps :)!

View original

5 replies

Nicole Chiroli
Pipefy Staff
Forum|alt.badge.img+10

Hello @gonzalo9, how are you doing today?

You can use our API to delete them. 
 

mutation{

a1: deleteTableRecord(input:{Id:xxxxx}){success}
a2: deleteTableRecord(input:{Id:xxxxx}){success}
}

and so on. 

The ID:xxxx would be the IDs of the records you wish to delete. We recommend you delete, tops, 150 at a time. I hope it helps! :) 


gonzalo9
  • Author
  • New Member
  • 11 replies
  • August 26, 2020

Thanks, how i can view for all records the IDs?


Nicole Chiroli
Pipefy Staff
Forum|alt.badge.img+10
  • Product Manager
  • 301 replies
  • Answer
  • August 26, 2020

Hey, @gonzalo9. Good morning :)

You can find them through the API as well like this:
{
  table_records(first: 30, table_id: "s5UuWo_N") {
    edges {
      node {
        id
        title
        }
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

It is important to stress that, if you are going to check it through API, we have pagination so you can see all cards within the phase. The current limit of cards/records shown is 30 cards per phase and 50 cards per pipe/db.


Pagination works like this; you will set the pageInfo 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:{
  phase(id: 6158453) {
    name
    cards (first:30 after: "WzQzODY0NDcwXQ==") {
      pageInfo{
        endCursor
        hasNextPage
      }
      edges {
        node {
          fields{
            value
            field{
              id
              label
            }
          }
          id
          title
          createdAt
          done


          pipe {
            id
            name
          }
          creatorEmail
          current_phase {
            id
            name
          }
        }
      }
    }
  }
}

 

You can also create an ID field and check from inside the database:
 


Hope it helps :)!


ivan.novofoco
Forum|alt.badge.img+10
  • Pipefy Certified Partner
  • 136 replies
  • August 28, 2020

@Janaina_Barreto

Look at this tip about deleting records in a database.


Alex Dowbor
  • New Member
  • 6 replies
  • March 16, 2022

Just a small comment/correction, I had to use “id” (all lowercase) instead of “Id” - otherwise it will fail with “Argument 'id' on InputObject 'DeleteTableRecordInput' is required. Expected type ID!".

#this will FAIL on the Id as it requires "id" in lowercase
mutation{

a1: deleteTableRecord(input:{Id:xxxxx}){success}
a2: deleteTableRecord(input:{Id:xxxxx}){success}
}
#this works as it uses lowercase id
mutation {
  D2: deleteTableRecord(input: {id: 499677723}) {
    success
  }
}

 


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