Parsing HTML and Plain Text Response Bodies Using "Capture"

Alex Wolfe
Alex Wolfe
  • Updated

For plain text or HTML responses (but not XML or JSON), string values can be extracted into appended data by mapping regular expressions to “capture” variables.

For example, with a response like:

Image

and this mapping in the outbound step:

Image

The value from the regular expression’s match group will be appended to the lead data:

Image

Note: The formulation of expression can be tricky, especially for long or multi-line responses. Mapped regular expression values are lowercased, so take that into consideration, or use syntax like /.../i.

Line-separators in the response may not match anchors (^ & $) as expected, so the “multiline” modifier may be needed (/.../m).

Another example, which will result in title being set with “The Raven”:

Response:

Image

Mapping:

Image

Result:

Image

Mapping captured parameters into rules or outbound steps.

Parameters that have been appended using “Capture” don’t show up in the field dropdown as do other appended parameters. Here’s how to map them:

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.