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

Various doc improvements #374

Merged
merged 3 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ If you'd like to manage your **Version**, use these commands:
* `zapier migrate [1.0.0] [1.0.1] [100%]` - move users between versions, regardless of deployment status
* `zapier deprecate [1.0.0] [YYYY-MM-DD]` - mark a version as deprecated, but let users continue to use it (we'll email them)
* `zapier env 1.0.0 [KEY] [value]` - set an environment variable to some value
* `zapier delete version [1.0.0]` - delete a version entirely. This is mostly for clearing out old test apps you used personally. It will fail if there are any users. You probably want `deprecate` instead.

> Note: To see the changes that were just pushed reflected in the browser, you have to manually refresh the browser each time you push.

Expand Down Expand Up @@ -469,7 +470,7 @@ In some cases, it might be necessary to provide fields that are dynamically gene
[insert-file:./snippets/custom-fields.js]
```

Additionally, if there is a field that affects the generation of dynamic fields, you can set the `altersDynamicFields: true` property. This informs the Zapier UI that whenever the value of that field changes, fields need to be recomputed. An example could be a static dropdown of "dessert type" that will change whether the function that generates dynamic fields includes a field "with sprinkles."
Additionally, if there is a field that affects the generation of dynamic fields, you can set the `altersDynamicFields: true` property. This informs the Zapier UI that whenever the value of that field changes, fields need to be recomputed. An example could be a static dropdown of "dessert type" that will change whether the function that generates dynamic fields includes a field "with sprinkles." If your field affects others, this is an important property to set.

```js
[insert-file:./snippets/alters-dynamic-fields.js]
Expand All @@ -493,8 +494,6 @@ In the UI, users will see something like this:

![screenshot of dynamic dropdown in Zap Editor](https://cdn.zapier.com/storage/photos/dd31fa761e0cf9d0abc9b50438f95210.png)

> Dynamic dropdowns are one of the few fields that automatically invalidate Zapier's field cache, so it is not necessary to set `altersDynamicFields` to true for these fields.

### Search-Powered Fields

For fields that take id of another object to create a relationship between the two (EG: a project id for a ticket), you can specify the `search` property on the field to indicate that Zapier needs to prompt the user to setup a Search step to populate the value for this field. Similar to dynamic dropdowns, the value for this property is a dot-separated concatenation of a search's key and the field to use for the value.
Expand Down Expand Up @@ -687,7 +686,7 @@ module.exports = {


### `bundle.cleanedRequest`
> `bundle.cleanedRequest` is only available in the `perform` for web hooks and `getAccessToken` for oauth authentication methods
> `bundle.cleanedRequest` is only available in the `perform` for webhooks and `getAccessToken` for oauth authentication methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a period at the end of the sentence? The same goes other similar places in this doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked them all! They all end in punctuation now.


`bundle.cleanedRequest` will return a formatted and parsed version of the request. Some or all of the following will be available:

Expand All @@ -707,6 +706,21 @@ module.exports = {
}
```

### `bundle.targetUrl`

> `bundle.targetUrl` is only available in the `performSubscribe` and `performUnsubscribe` methods for webhooks

This the url to which you should send hook data. It'll look something like `https://hooks.zapier.com/1234/abcd`. We provide it so you can make some sort of POST request to your server and store this as a destination for new info.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with both url and URL, but we should be consistent across the entire document. So I think we should be using URL here.

Also, I'd suggest editing this:

We provide it so you can make some sort of POST request to your server and store this as a destination for new info.

to:

We provide it so we can make a POST request to your server, and your server should store this URL to hit when there's new data.


Read more in the [REST hook example](https://github.com/zapier/zapier-platform-example-app-rest-hooks/blob/master/triggers/recipe.js).

### `bundle.subscribeData`

> `bundle.subscribeData` is only available in the `performUnsubscribe` method for webhooks

This is an object that contains the data you returned from the `performSubscribe` function. It should contain whatever information you need send a `DELETE` request to your server to stop sending webhooks to Zapier.

Read more in the [REST hook example](https://github.com/zapier/zapier-platform-example-app-rest-hooks/blob/master/triggers/recipe.js).

## Environment

Expand Down
4 changes: 3 additions & 1 deletion src/commands/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ A shortcut for \`zapier build && zapier upload\` - this is our recommended way t

> Note: this is always a safe operation as live/production apps are protected from pushes. You must use \`zapier promote\` or \`zapier migrate\` to impact live users.

If you have not yet registered your app, this command will prompt you for your app title and register the app.
> Note: this will overwrite the version specified in your \`package.json\`. If you want to push to a new version, increment the "version" key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be more specific by saying

..., increment the "version" key in package.json.


If you have not yet registered your app, this command will prompt you for your app title and to register the app.

${'```'}bash
$ zapier push
Expand Down