Best way to parse information from a webhook

Hey guys, I’ve got a jotform that returns info to a scenario via webhook. As of right now it returns all the form answers in a variable called “pretty” that’s basically a list of all the content from the form, formatted as “answerA:text, answerB:text, answerC:text,” etc etc. Is there a way to parse this within Make so it returns each answer as a separate variable that I can manipulate like any other data? I tried using Split and got the variable/value pairs to separate, but I’m still not able to access them all as easily as I’d like. Picture enclosed:

Hi there,

You can use the “split” function like this:

output:
image

Now you have the item in the array.

just use the “get” function to get any item you want (1 or 2)

For item1:

Output:

image

And likewise for item 2 as well.

Hope this helps! :slight_smile:

2 Likes

Welcome to the Make community!

1. Match

You can use a Text Parser “Match Pattern” module with this regular expression pattern

(?<key>[^,]+?):(?<value>[^,]+)(?:, )?

Regex test: https://regex101.com/r/aMsYz1

Important Info

  • :warning: Global match must be set to YES!

Screenshot
Screenshot_2023-12-12_081202

Output
Screenshot_2023-12-12_081230

2. Combine

Then, you can use an Array Aggreagtor to combine the matches

Screenshot

Output
Screenshot_2023-12-12_081258

Usage Example in a later module

Get value where key is “Pressure Units”:
Screenshot_2023-12-12_091239
{{ map(5.array; "value"; "key"; "Pressure Units") }}

You can stop here if this is all you need.

3. (optional) If you want mappable keys, use toCollection

Screenshot

Output
Screenshot_2023-12-12_081222

Usage Example in a later module
Screenshot_2023-12-12_091206

3 Likes