-
Notifications
You must be signed in to change notification settings - Fork 66
Add code examples and scenarios to the dynamic dropdowns section of the Readme #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, so this is a good start!
The biggest thing is that you need to make changes in readme-source.md
and then run npm run docs
to make those changes in the actual readme. This isn't obvious and i'll make a note in the new issue template to be more clear about it.
Also, any snippets that aren't tiny (< 5 lines) should go in their own file and included via [insert-file:./snippets/app-def.js]
Lastly, it looks like prettier
got run on the readme. There was a reason we didn't want that to happen (though I can't currently remember why exactly - something about list spacing, maybe?), but we can keep it if everything looks good.
Thanks a ton for helping with our docs and let me know if any of the above doesn't make sense!
README.md
Outdated
``` | ||
|
||
> 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. | ||
Sometimes, API endpoints require clients to specify a parent object in order to create or access the child resources. For instance, specifying a spreadsheet id in order to retrieve it's worksheets. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: it's
-> its
To define one, you can provide the `dynamic` property on your field to specify the trigger that should be used to populate the options for the dropdown. The value for the property is a dot-separated concatenation of a trigger's key, the field to use for the value, and the field to use for the label. | ||
To define one you include the `dynamic` property on the `inputFields` object. The value for the property is a dot-separated _string_ concatenation. | ||
|
||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be moved into a snippet. create a new file in the snippet directory and then replace this block with [insert-file:./snippets/app-def.js]
. See this: https://github.com/zapier/zapier-platform-cli/blame/5dffe11f4322466f873f628c50ce8996c5ba44ca/README-source.md#L183
README.md
Outdated
}; | ||
``` | ||
|
||
The Google Sheets integration is an example of this pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe link to the zapbook page for sheets here?
README.md
Outdated
@@ -1416,8 +1562,8 @@ This object holds the user's auth details and the data for the API requests. | |||
|
|||
```js | |||
{ | |||
createdBy: 'his name is Bobby Flay' | |||
style: 'he cooks mediterranean' | |||
createdBy: 'his name is Bobby Flay'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these semis are incorrect. there should be a comma on the first one though
@xavdid thanks for guiding me through that process and those great suggestions in the review. I've made those and hopefully nothing extra happened this time round. My editor auto ran Prettier on the Readme last time. I've changed that setting now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, thank you! prettier is usually a good thing (I ❤️ it) but just in this specific case, it did had weird behavior.
In any case, thank you! feel free to merge at your convenience.
We regularly get
dev-app
questions in the T2 queue where they are confused about dynamic dropdowns. This pull request seeks to reduce those tickets by: