Skip to main content
Solved

createTableRecord

  • October 27, 2020
  • 2 replies
  • 247 views

Sérgio Moreira

Hello.
Please, I need include Assignee select on database. But at field persist empty.

follow code.
mutation {
createTableRecord(input:{
table_id:"pWRuu4qV",
fields_attributes:[
{field_id:"suplente",field_value:"["aaaaaaaaaaaaa"]"},
]
}) {
clientMutationId
}
}

Tks.

Best answer by Roberto Chavarria

Hello Sérgio, hope all is well! 
You’d need to use the user’s ID instead of text.
Here is an example of how to execute this query correctly: 
 

mutation {createTableRecord(input: {
  table_id: "pWRuu4qV"
  title:"Title of record"
  fields_attributes:[
    {field_id: "assignee_field", field_value: [123456, 654321]} 
    {field_id:"short_text_field", field_value:"text here"}
  ]})
}

I added another field “short_text_field”, but it’s just for demonstration’s sake of how you would fill out multiple fields.

Note: In this example, “ {field_id: "assignee_field", field_value: [123456, 654321]} ” will add the users with the IDs 123456 and 654321 as the field assignees for this record. So 2 users will be added.

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

2 replies

Roberto Chavarria
Pipefy Staff
Forum|alt.badge.img+5

Hello Sérgio, hope all is well! 
You’d need to use the user’s ID instead of text.
Here is an example of how to execute this query correctly: 
 

mutation {createTableRecord(input: {
  table_id: "pWRuu4qV"
  title:"Title of record"
  fields_attributes:[
    {field_id: "assignee_field", field_value: [123456, 654321]} 
    {field_id:"short_text_field", field_value:"text here"}
  ]})
}

I added another field “short_text_field”, but it’s just for demonstration’s sake of how you would fill out multiple fields.

Note: In this example, “ {field_id: "assignee_field", field_value: [123456, 654321]} ” will add the users with the IDs 123456 and 654321 as the field assignees for this record. So 2 users will be added.


vitoria36
  • Regular Participant
  • 2 replies
  • June 17, 2021
Roberto Chavarria wrote:

Hello Sérgio, hope all is well! 
You’d need to use the user’s ID instead of text.
Here is an example of how to execute this query correctly: 
 

mutation {createTableRecord(input: {
  table_id: "pWRuu4qV"
  title:"Title of record"
  fields_attributes:[
    {field_id: "assignee_field", field_value: [123456, 654321]} 
    {field_id:"short_text_field", field_value:"text here"}
  ]})
}

I added another field “short_text_field”, but it’s just for demonstration’s sake of how you would fill out multiple fields.

Note: In this example, “ {field_id: "assignee_field", field_value: [123456, 654321]} ” will add the users with the IDs 123456 and 654321 as the field assignees for this record. So 2 users will be added.

 

This isn't working anymore. I got the following error:

{"errors":[{"message":"Field must have selections (field \'createTableRecord\' returns CreateTableRecordPayload but has no selections. Did you mean \'createTableRecord { ... }\'?)","locations":[{"line":2,"column":11}],"path":["mutation","createTableRecord"],"extensions":{"code":"selectionMismatch","nodeName":"field \'createTableRecord\'","typeName":"CreateTableRecordPayload"}}]}

 


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