Skip to main content
Solved

How do I get and insert data to a table via Postman?


rafael-pitanga

Hi all,

 

How can I find a simple example of how to search table data and to insert data into a custom table with columns like: “Title”, “First Name”, “Last Name” and “E-mail”. I am trying that using Postman, but the only response I got was Bad Request. Is there any link or tutorial explaining how to achieve that?

 

Thanks! 

Best answer by rafael-pitanga

I managed to insert with this:

mutation{
    createTableRecord(
        input: {
            table_id: "table id",
            title: "Teste (colaboradores)",
            fields_attributes: [
                {field_id: "email_pessoal", field_value: "email@email.com.br"},
                {field_id: "nome_completo", field_value: "nome completo"},
                {field_id: "matr_cula", field_value: "12345"}]
            }
    )
    {
        table_record { id }
    }
}

I just don't know how to add multiple records at once. 

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

3 replies

rafael-pitanga
  • Author
  • Regular Participant
  • 1 reply
  • Answer
  • June 15, 2022

I managed to insert with this:

mutation{
    createTableRecord(
        input: {
            table_id: "table id",
            title: "Teste (colaboradores)",
            fields_attributes: [
                {field_id: "email_pessoal", field_value: "email@email.com.br"},
                {field_id: "nome_completo", field_value: "nome completo"},
                {field_id: "matr_cula", field_value: "12345"}]
            }
    )
    {
        table_record { id }
    }
}

I just don't know how to add multiple records at once. 


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

Perfect, @rafael-pitanga 

Do you need more help on that?


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • June 22, 2022

To insert more than one record at once, you can use multiple queries in the same request. An example would be:

mutation{
    N0 createTableRecord(
        input: {
            table_id: "table id",
            title: "Teste (colaboradores)",
            fields_attributes: [
                {field_id: "email_pessoal", field_value: "email@email.com.br"},
                {field_id: "nome_completo", field_value: "nome completo"},
                {field_id: "matr_cula", field_value: "12345"}]
            }
    )
    {
        table_record { id }
    }
    N1 createTableRecord(
        input: {
            table_id: "table id",
            title: "Teste2 (colaboradores)",
            fields_attributes: [
                {field_id: "email_pessoal", field_value: "email2@email.com.br"},
                {field_id: "nome_completo", field_value: "nome completo2"},
                {field_id: "matr_cula", field_value: "6789"}]
            }
    )
    {
        table_record { id }
    }
}

for two at once. The “N0” and “N1” can be any alphanumeric string (or not even there) and would allow you to associate the results with the queries/mutations.

 

Note that there is a certain limit to the nr of queries and/or mutations you can make at once, somewhere around 30 I belive.


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