Get Pipefy data

p.card(ID)

Return Promise with current card in the context as result

Example Call

// Return current card in the context
p.card().then(function(card) {
  console.log(card) // { id: '23abc', ... }
});

Return

{
  id: "Vtp5gHjo",
  title: "Hotdog App",
  assigness: [
    {
      name: "Jim Yang",
      username: "jim yang",
      avatar_url: "https://gravatar.com/avatar/5e071a20cf0898300c"
    }
  ],
  labels: [
    { id: 2334, title: 'High', color: '#CCCCCC' }
  ],
  field_values: [
    {
    	start_date: "2017-02-19T01:58:08+00:00",
      approved: false,
    }
  ],
  current_phase: {
    name: 'Doing',
    description: 'Show time!',
    done: false,
  },
]

p.fields()

Return fields of current Pipe

Example call

p.fields().then((fields) => {
  console.log(fields); // [{ id: "title", .... }]
});

Return

[
  {
    id: "follow_the_steps_below_before_moving_the_card_forward",
    description: "If you're not sure what to do here, click the \"?\" icon to learn more.",
    label: "Follow the steps below before moving the card forward:",
    phase: {id: 1357961, name: "Empathize", done: false, start_form: true},
    required: false,
    type: "Statement"
  }
]

p.pipe()

Return current Pipe attributes

Return

{
  id:"-Pclaixx",
  name:"Sprint Planning",
  organization_name:"Pied Piper",
  cards_count: 4,
}

p.cardAttachments()

Return current card Apps attachments, those attached using p.attach function.

Return

Promise will resolve to an array with list of card app attachments object. This object contains the attachment id, url and name.

Example

p.cardAttachments().then((attachments) => {
  console.log(attachments) //[{id: "LPpssdkK", url: "https://emojipedia.org/shrug/", name: "Shrug 🤷"}]
});

p.timezone()

Return current user timezone (tz database timezone name)

p.timezone().then((timezone) => {
  console.log(timezone) // "America/Los_Angeles"
});

p.locale

Return current user locale, example: en-gb, pt-br, en, ru, es and fr.

const locale = p.locale
console.log(locale) // "pt-br"

What’s Next