Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #296 from zapier/nested-dynamicfunctions
Browse files Browse the repository at this point in the history
Add note about nested dynamic functions
  • Loading branch information
FokkeZB authored Apr 12, 2018
2 parents bbf4856 + b3b1a12 commit 56502a6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ In some cases, it might be necessary to provide fields that are dynamically gene

> You should see `bundle.inputData` partially filled in as users provide data - even in field retrieval. This allows you to build hierarchical relationships into fields (EG: only show issues from the previously selected project).
> A function that returns a list of dynamic fields cannot include additional functions in that list to call for dynamic fields.
```javascript
[insert-file:./snippets/custom-fields.js]
```
Expand All @@ -477,6 +479,8 @@ Additionally, if there is a field that affects the generation of dynamic fields,
[insert-file:./snippets/alters-dynamic-fields.js]
```

> Only dropdowns support `altersDynamicFields`.
### Dynamic Dropdowns

Sometimes, API endpoints require clients to specify a parent object in order to create or access the child resources. Imagine having to specify a company id in order to get a list of employees for that company. Since people don't speak in auto-incremented ID's, it is necessary that Zapier offer a simple way to select that parent using human readable handles.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ In some cases, it might be necessary to provide fields that are dynamically gene

> You should see `bundle.inputData` partially filled in as users provide data - even in field retrieval. This allows you to build hierarchical relationships into fields (EG: only show issues from the previously selected project).
> A function that returns a list of dynamic fields cannot include additional functions in that list to call for dynamic fields.
```javascript
const recipeFields = (z, bundle) => {
const response = z.request('http://example.com/api/v2/fields.json');
Expand Down Expand Up @@ -974,6 +976,8 @@ module.exports = {

```

> Only dropdowns support `altersDynamicFields`.
### Dynamic Dropdowns

Sometimes, API endpoints require clients to specify a parent object in order to create or access the child resources. Imagine having to specify a company id in order to get a list of employees for that company. Since people don't speak in auto-incremented ID's, it is necessary that Zapier offer a simple way to select that parent using human readable handles.
Expand Down
13 changes: 13 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,8 @@ <h3 id="customdynamic-fields">Custom/Dynamic Fields</h3>
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>In some cases, it might be necessary to provide fields that are dynamically generated - especially for custom fields. This is a common pattern for CRMs, form software, databases and more. Basically - you can provide a function instead of a field and we&apos;ll evaluate that function - merging the dynamic fields with the static fields.</p><blockquote>
<p>You should see <code>bundle.inputData</code> partially filled in as users provide data - even in field retrieval. This allows you to build hierarchical relationships into fields (EG: only show issues from the previously selected project).</p>
</blockquote><blockquote>
<p>A function that returns a list of dynamic fields cannot include additional functions in that list to call for dynamic fields.</p>
</blockquote>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
Expand Down Expand Up @@ -1863,6 +1865,17 @@ <h3 id="customdynamic-fields">Custom/Dynamic Fields</h3>
</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<blockquote>
<p>Only dropdowns support <code>altersDynamicFields</code>.</p>
</blockquote>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<h3 id="dynamic-dropdowns">Dynamic Dropdowns</h3>
Expand Down

0 comments on commit 56502a6

Please sign in to comment.