Solved

createTableRecord

  • 27 October 2020
  • 2 replies
  • 184 views

Userlevel 3

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.

icon

Best answer by Roberto Chavarria 27 October 2020, 19:42

View original

2 replies

Userlevel 5
Badge +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.

Userlevel 2

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"}}]}

 

Reply