Skip to main content
Best answer

Resource not passing down outputFields


tabitabibito

Hello! I’m currently building a Zapier integration. I have a resource - let’s call it “pet”. “pet” has list, search, and create actions defined. Now, since all of these have the same output format, I’d like to define `outputFields` and `sample` once in the main resource object and be done with it. The docs suggest that this is possible, and that my actions should automatically inherit `outputFields` and `sample` from the parent resource. However, when I try to test these functions with a Zap I created, the `label` for each of the output fields do not appear:

This is supposed to say “Pet ID”, for example; the field is defined in the resource as follows:

export const pet = {
  ...,
  list: ...,
  create: ...,
  search: ...,


  outputFields: [
    {
      key: 'id',
      label: 'Pet ID',
      type: 'string',
    },
  ],
}

How can I get my resource to automatically pass down its outputFields/sample to its actions (list, create, search in this case)?

I found that if I manually go into each of the actions and specify something like `outputFields: pet.outputFields` then it will work. However, I’m wondering if this is truly necessary, since it seems reasonable to be able to define it once in the resource and have it carry over.

Best answer by tabitabibitoBest answer by tabitabibito

Solved it; had to manually specify the `resouce` field for each of the actions. I had assumed it was automatically set when it was included in the resource.

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

tabitabibito
  • Author
  • Beginner
  • 1 reply
  • Answer
  • August 6, 2021

Solved it; had to manually specify the `resouce` field for each of the actions. I had assumed it was automatically set when it was included in the resource.


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7547 replies
  • August 10, 2021

That’s fantastic! Thanks so much for sharing your solution here, @tabitabibito! :)