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

Outbound Webhook JSON: improve UX/DX by providing advanced parsing/data wrangling #33

Open
I-Dont-Remember opened this issue Oct 20, 2022 · 6 comments
Labels
enhancement New feature or request Nice To Have Improves the tool, but isn't a make or break for users.

Comments

@I-Dont-Remember
Copy link
Contributor

I-Dont-Remember commented Oct 20, 2022

Original title: Better UX for multi-line/list data in Outbound Webhook JSON. Updated to reflect the base feature was added, but now this issue can track other enhancements in the same vein.

A fairly common use case is to ask users for a list of 0-many items in a form, which can then get sent via webhook to Zapier, Make, etc. Many people accomplish this with a multi-line text input and then ask users to put each item on a newline, .e.g:

https://example.com/abc
https://example.com/123
https://example.com/def

image

See screenshot of example. This variable will then show up in your JSON as string with \n separating each item:

{
    "key": "https://example.com/abc\nhttps://example.com/123\nhttps://example.com/def"
}

Is there a benefit to us providing an option to convert these string lists into true JSON lists? How might we provide this configuration in a way that provides value to users?

{
  "key": [
    "https://example.com/abc",
    "https://example.com/123",
    "https://example.com/def"
  ]
}
@I-Dont-Remember
Copy link
Contributor Author

One potential solution: provide another boolean Flag option for convert keys with newlines into lists - that would be simple enough to check for. User experience wise, it does mean they wouldn't have control at a granular per-key level to switch it on and off. Having one key with newlines they want to keep and one with newlines they want as a list is a very niche use case, considering we're already talking about a very niche use-case to start with.

@jphorn
Copy link

jphorn commented Oct 20, 2022

I think the Outgoing Webhook option (or WF Buddy in general) in itself is heavily geared to devs/tech savvy users anyway, so this option seems fine by me, as opposed to getting the result in a single value with control chars like \n or \t.

If we have clarity what output to expect, we're able to work around it either way. Considering the targeted audience and the niche use case I guess a proper json list is easiest to process further down the chain (e.g. Make/Zapier/own API) instead of having to fiddle with parsing control chars. Also because it's fairly easy to concat a json list. So I'd say to ditch the granular level of control.

But... maybe it'd be feasible to use the first line for multiline inputs as a configuration, e.g. [list] or [blob] and then have WF Buddy check if one of these values exists as return value and then let WF Buddy do its own parsing to correctly return the output. If neither value exists as first line, than just return the form field as single blob. That would allow for granular level and negates the need for a boolean flag.

@I-Dont-Remember
Copy link
Contributor Author

I-Dont-Remember commented Oct 20, 2022

Discussed externally - the idea above has some good direction, but in the current form would move onus of control from person building Workflow to the person providing data input - harder to control. BUT I like where the idea is headed. Also depending on the users, might not be that hard to get people to be "trained" to do it right, so might still be viable.

🧠 One use case for idea could be when the workflow designer is putting together the JSON body, have a block at the top we reserve for "advanced flags". Could be an interesting way to expose more capabilities without cluttering up screen with tons of checkboxes.

@I-Dont-Remember
Copy link
Contributor Author

Another potential approach: use special characters in the name of a field to indicate action should be taken. Zapier has it so any field prefixed with __ wll be "unflattened" into nested dictionaries (see image). We could do something similar where if a field is prefixed with [] (or better chars :D ) then we will convert any newlines into a list. Then this stays under control of the Workflow builder

image

I-Dont-Remember added a commit that referenced this issue Oct 20, 2022
…webhook parsing - first one: converting to list
@I-Dont-Remember I-Dont-Remember added the enhancement New feature or request label Oct 20, 2022
@I-Dont-Remember I-Dont-Remember changed the title Better UX for multi-line/list data in Outbound Webhook JSON Outbound Webhook JSON: improve UX/DX by providing advanced parsing/data wrangling Oct 20, 2022
@I-Dont-Remember
Copy link
Contributor Author

Now that we have ability to do __ to have Buddy wrangle the data into a list, it opens the door for other future prefix combos to do creative things that I don't know yet -- leaving this issue open as those potential features arise!

@jphorn
Copy link

jphorn commented Nov 8, 2022

Hi. I ran into another issue with multi-line form input, where JSON trips over certain characters. One was very easy to find, but also extremely common: use of quotation marks in the full body. I guess these need to be escaped?

The other one I'm having a really hard time to dissect, because Slack/Workflow Buddy error output isn't showing me the right line. I can give you the examples privately via Slack.

@I-Dont-Remember I-Dont-Remember added the Nice To Have Improves the tool, but isn't a make or break for users. label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Nice To Have Improves the tool, but isn't a make or break for users.
Projects
None yet
Development

No branches or pull requests

2 participants