Skip to main content
Solved

Creating new card using GraphQL

  • February 22, 2021
  • 2 replies
  • 685 views

Sérgio Moreira


I'm trying to create a new card:mutation {
createCard(
input: {
pipe_id: ""XXX""
fields_attributes: {field_id:""ZZZ"", field_value: ""AAA""}
parent_ids: [ ]
}
) { card { id title } }
}The field_id is related to a Database connection. The field_value is a record from that Database.The pipe has the connection configured. Manually we can enter that field with no problems, but, using the API I got the following error:{
""data"": {
""createCard"": null
},
""errors"": [
{
""code"": 30006,
""locations"": [
{
""column"": 10,
""line"": 1
}
],
""message"": ""Invalid inputs: Erro no campo \""ZZZ\"": Value You don't have permission to connect these cards/table records."",
""path"": [
""createCard""
],
""type"": ""MultipleInvalidInputErrors""
}
]
}

Best answer by genietim

I can imaging your problem to be the missing [] around your fieldValueInput.

Instead of

fields_attributes: {field_id:"ZZZ", field_value: "AAA"}

it needs to be

fields_attributes: [{field_id: "ZZZ", field_value: "AAA"}]

 

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

2 replies

genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • February 23, 2021

I do not know if this is just the formatting here in the Pipefy Community (if you can still edit, please use the “Code” format, to be found in:

Where to find the code format

), but you have some issues with the number of quotation marks (“). Could this be your problem? Also, feel free to use the network tab in your browsers dev tools to checkout the actual mutation that Pipefy itself uses when creating a card.


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • Answer
  • February 23, 2021

I can imaging your problem to be the missing [] around your fieldValueInput.

Instead of

fields_attributes: {field_id:"ZZZ", field_value: "AAA"}

it needs to be

fields_attributes: [{field_id: "ZZZ", field_value: "AAA"}]

 


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