Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUPPORTENG-394] docs(cli): Add information about how to return line items #620

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

armchairlinguist
Copy link
Contributor

The question of how to correctly return line items comes up periodically, to the point where we maintain an internal reference. This addition will allow developers curious about how to return line items to better self-serve.

RasHanz
RasHanz previously approved these changes Feb 9, 2023
Copy link

@RasHanz RasHanz left a comment

Choose a reason for hiding this comment

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

Note: I just reviewed one pair of documents. I'm assuming the other two are necessary duplicates.

The only change I'd ask you to consider, @armchairlinguist, is the one about the "for examples", but I won't be opposed if you decide not to include that.

Feel free to send another review request if you include it, and I'll approve it quickly.

Comment on lines +536 to +538
| Trigger | Array | 0 or more objects; passed to the [deduper](https://platform.zapier.com/docs/dedupe/) if polling |
| Search | Array | 0 or more objects. Only the first object will be returned, so if len > 1, put the best match first |
| Action | Object | Return values are evaluated by [`isPlainObject`](https://lodash.com/docs#isPlainObject) |
| Create | Object | Return values are evaluated by [`isPlainObject`](https://lodash.com/docs#isPlainObject) |
Copy link

Choose a reason for hiding this comment

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

Nice catches!

packages/cli/README-source.md Outdated Show resolved Hide resolved
users: [
{ name: 'Zap Zaplar', age: 12, city: 'Columbia', region: 'Missouri' },
{ name: 'Orange Crush', age: 28, city: 'West Ocean City', region: 'Maryland' },
{ name: 'Lego Brick', age: 91, city: 'Billund', region: 'Denmark' },
Copy link

Choose a reason for hiding this comment

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

    _ 
   [_] 
 /;   :\
()'---' C
  | | |
  [=|=]


A standard search would return just the inner array of users, and only the first user would be provided as a final result. Returning line items instead means that the "first result" return is the object containing all the user details within it.

Using the standard approach is recommended, because not all Zapier integrations support line items directly, so users may need to take additional actions to reformat this data for use in their Zaps. More detail on that at [Use line items in Zaps](https://zapier.com/help/create/basics/use-line-items-in-zaps). However, there are use cases where returning multiple results is helpful enough to outweigh that additional effort.
Copy link

Choose a reason for hiding this comment

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

I like that link!

RasHanz
RasHanz previously approved these changes Feb 10, 2023
Copy link

@RasHanz RasHanz left a comment

Choose a reason for hiding this comment

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

LGTM! (sorry it took me a bit)

@armchairlinguist
Copy link
Contributor Author

Thanks! I'll leave it open til Monday in case anyone on the eng team has feedback, as well.

eliangcs
eliangcs previously approved these changes Feb 13, 2023
Copy link
Member

@eliangcs eliangcs left a comment

Choose a reason for hiding this comment

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

Happened to see a reference of an old platform version. It's unrelated to your changes, but it'd be nice to remove it too. Otherwise, this PR looks good to me, thanks!

packages/cli/README-source.md Outdated Show resolved Hide resolved
Co-authored-by: Chang-Hung Liang <[email protected]>
@armchairlinguist armchairlinguist merged commit f308f29 into main Feb 16, 2023
@armchairlinguist armchairlinguist deleted the SUPPORTENG-394-return-line-items-from-a-step branch February 16, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants