Skip to main content
Released

GraphQL API to manipulate Pipes (& fields)

  • December 24, 2020
  • 9 replies
  • 1016 views
genietim
Ezequiel Souza
alicereis
marcosmelo
  • genietim
    genietim
  • Ezequiel Souza
    Ezequiel Souza
  • alicereis
    alicereis
  • marcosmelo
    marcosmelo

genietim

I would like to be able to change the fields on a pipe using an API. Use cases:

  • automatically synchronize product list with some accounding program (e.g. arcitle-lists from Sage) → change in Sage would lead to new selection options in select-input and/or lead to new input fields, e.g. for articles added in Sage which are accounted per hour
  • import/export pipes, e.g. between organizations or even from another service

9 replies

mozart-morales
Pipefy Staff

Hello, @genietim  I hope everything is fine with you and your family.
I did a quick demonstration of how to edit a field using our api.
Check here 🔗
If you have any questions just let me know.

Step by step:

Mutations:


1. use mutation to get the field id.

{
  pipe(id:yourpipeid) {
    id
    start_form_fields {
      id
      internal_id
      index_name
      label
    }
    phases {
      id
      name
      fields {
        internal_id
        id
        label
      }
    }
  }
}

return:

{
  "data": {
    "pipe": {
      "id": "your pipe id",
      "start_form_fields": [
        {
          "id": "your field id",
          "internal_id": "your internal field id",
          "index_name": "your field index name",
          "label": "your field label"
        },
        {


2. use mutation to change the field

mutation{
  updateFieldsValues(input:{
    nodeId: "your card ID"
    values: [
      {fieldId: "field id that you would like to update",
        value: "value that you would like to insert"}]
  }) {
    clientMutationId
    success
  }
}

 

:) 


genietim
Forum|alt.badge.img+12
  • Author
  • Pipefy Legend
  • 412 replies
  • December 31, 2020

Hi @mozart-morales 

Thanks for your answer. Unfortunately, this is not what I am looking for: I do know I can change the value, but what I want to do is to change the field itself (e.g. the select options for a checkbox/radio/select field) (resp. add a new field) using the GraphQL API.

I did find the relevant mutations though when I just checked again (I do not know why I did not find them the last few times):

, so, you can delete this idea or mark it as “implemented”.


mozart-morales
Pipefy Staff

got it ! @genietim 

Yes perfect :) You can use the: https://api-docs.pipefy.com/reference/mutations/updatePhaseField/?_ga=2.223388754.872255537.1609155391-1804306626.1586443343 

short example:

updatePhaseField
mutation {
  updatePhaseField(
    input: {
      id: "field ID"
      label: "field label"
      options: ["option1", "option2" // if is option field :) ]
      required: false
      editable: true
    }
  ) {
    phase_field {
      id
      label
    }
  }

Thanks for your answer :) ! Have a great day!


Juliana Spinardi
Pipefy Staff
Forum|alt.badge.img+8
Updated idea status NewSubmitted

genietim
Forum|alt.badge.img+12
  • Author
  • Pipefy Legend
  • 412 replies
  • January 19, 2021

@Juliana Spinardi : that’s the wrong label; “Implemented” would be better suited.


Juliana Spinardi
Pipefy Staff
Forum|alt.badge.img+8
Updated idea status SubmittedReleased

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

@genietim you’re right! Updated! 
Thanks!!


Antonio van
  • New Member
  • 1 reply
  • November 12, 2024

I'm having some trouble using updatePhaseField in a start form. Any ideas of what to do?

Many thanks!


genietim
Forum|alt.badge.img+12
  • Author
  • Pipefy Legend
  • 412 replies
  • November 12, 2024

Hi @Antonio van , I suggest you create a new topic with plenty of details of what the troubles are, then we can help there


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