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:
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:
And likewise for item 2 as well.
Hope this helps!
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
- Global match must be set to YES!
Screenshot
Output
2. Combine
Then, you can use an Array Aggreagtor to combine the matches
Screenshot
Output
Usage Example in a later module
Get value where key is “Pressure Units”:
{{ 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
Usage Example in a later module
3 Likes