Solved

Having problem when trying to create table record ("The types ID and Statement do not accept values.")

  • 16 February 2022
  • 7 replies
  • 138 views

Userlevel 2

Hello all,

So I’m getting an error message when I try to create a table record on a certain database I’m using the same Generator I use for various other integrations but both through the normal API and and the GraphiQL tool it gives me:
 

{
"data": {
"createTableRecord": null
},
"errors": [
{
"message": "The types ID and Statement do not accept values.",
"locations": [
{
"line": 17,
"column": 11
}
],
"path": [
"createTableRecord"
],
"code": 30000,
"type": "PipefyRuntimeError"
}
]
}

 

 

The graphQL message I’m sending is this:

mutation{
createTableRecord(
input: {
table_id: {DB_ID},
title: "Sync",
due_date: "2020-08-26T00:00-03:00",
fields_attributes: [
{field_id:"nome_da_vaga", field_value: "Negócio Cafaz" },
{field_id: "gestor", field_value: "Tiago Andrade" },
{field_id: "hunter_da_vaga", field_value: "Lucas" },
{field_id: "prioridade", field_value: "" },
{field_id: "cliente", field_value: "Cafaz" },
{field_id: "rea", field_value: "Teste" },
{field_id: "tipo_de_vaga", field_value: "" },
{field_id: "descri_o_da_vaga", field_value: "Teste" },
{field_id: "regime_de_trabalho", field_value: "Home Office" },
{field_id: "carga_hor_ria", field_value: "4 horas/dia" },
{field_id: "remunera_o_recomendada", field_value: "R$ 3000,00" },
{field_id: "id_pipedrive", field_value: "2104" },
{field_id: "c_digo_da_vaga", field_value: "" },
{field_id: "data_fechamento", field_value: "" },
{field_id: "observa_o", field_value: "Teste" }]
}
) {
clientMutationId
}
}

 

Can someone help me solve this?

icon

Best answer by genietim 18 February 2022, 12:38

View original

7 replies

Userlevel 5
Badge +4

Hello there! This occurs due to statement and ID fields not being mutable. In other words, you cannot pass a value to those fields. You should be able to create the record by simply removing those fields from the mutation :)

Userlevel 2

@Roberto Chavarria I just don’t see where I’m passing this ID and statement that are not allowed.

The only ID field that I have in the mutation that should be imutable is the table ID and the field Ids so the API knows where to put the values. and as I said this graphQL is generated by a function that I use for many other integrations that are in production/working,

Userlevel 7
Badge +8

@gabrielsaboya the symbols for the ID and the Statement field are listed below. Are you sure that you did not accidently use the field type ID instead of a numeric one on e.g. the field “id_pipedrive”?

symbols in database fields: ID, statement

 

Userlevel 2

@gabrielsaboyathe symbols for the ID and the Statement field are listed below. Are you sure that you did not accidently use the field type ID instead of a numeric one on e.g. the field “id_pipedrive”?

symbols in database fields: ID, statement

 

@genietim do you think it can be the case of something like a label or selection field not being passed as such?

I have a label field, a field that select between the members of the DB and a couple of selection fields on this database

Userlevel 7
Badge +8

@gabrielsaboya hard to say without knowing your actual table setup. Could you send the results of a GraphQL Query like the following (change the table id):

 

query {
table(id: "<your table id>") {
table_fields{
id internal_id type
}
}
}

so I know what id you use in your query corresponds to what field type?

Userlevel 2

@genietim I thik I got it, I organized the  fields_attributes with the list that is returned to me by a query similar to this one you give on your comment.
The kicker is this returns me the recordID. I just configured it to be the last one so I can Iterate and just do until second to last, and will test soon enough.

The types are:

{
"data": {
"table": {
"table_fields": [
{
"id": "nome_da_vaga",
"internal_id": "328430140",
"type": "short_text"
},
{
"id": "gestor",
"internal_id": "328432497",
"type": "short_text"
},
{
"id": "hunter_da_vaga",
"internal_id": "329456447",
"type": "assignee_select"
},
{
"id": "prioridade",
"internal_id": "328551844",
"type": "label_select"
},
{
"id": "cliente",
"internal_id": "328430142",
"type": "short_text"
},
{
"id": "rea",
"internal_id": "328430166",
"type": "short_text"
},
{
"id": "tipo_de_vaga",
"internal_id": "335921178",
"type": "select"
},
{
"id": "descri_o_da_vaga",
"internal_id": "328430188",
"type": "long_text"
},
{
"id": "regime_de_trabalho",
"internal_id": "328430199",
"type": "radio_vertical"
},
{
"id": "carga_hor_ria",
"internal_id": "335334588",
"type": "radio_vertical"
},
{
"id": "remunera_o_recomendada",
"internal_id": "335495717",
"type": "currency"
},
{
"id": "id_pipedrive",
"internal_id": "336007868",
"type": "short_text"
},
{
"id": "data_fechamento",
"internal_id": "335682418",
"type": "date"
},
{
"id": "observa_o",
"internal_id": "328432298",
"type": "long_text"
},
{
"id": "c_digo_da_vaga",
"internal_id": "328430237",
"type": "id"
}
]
}
}
}

I still predict I will have another problem with assignee select, label_select and radio_vertical, as I think I should pass something similar to an array value instead of a normal string to them.

Userlevel 7
Badge +8

@gabrielsaboya thanks for the info, now I see what you have to delete: the field with the id "c_digo_da_vaga" is an ID type field, therefore, removing the line “{field_id: "c_digo_da_vaga", field_value: "" },” from your query should fix your issue.

Reply