Skip to main content

I’m receving a webhook with the JSON string:

{

"row": :{

"offline_conversion_date": "12/27/2022",

"gclid_value_first": "CjwKCAiA-dCcBhBQEiwAeWidtSTLlONJz_5fYxxgTKO-7M8dqKk7oadad5XwQl_1RysOBH7C7MtAkhoC6icQAvD_BwE",

}]

}

 

I want to extract “offline_conversion_date” and “gclid_value_first” separately.

 

I’ve tried a few JS and Extract Pattern options based on other posts but couldn’t quite crack it. 

 

Any help is appreciated!

Hi @carnegiehighered 

Good question.

Have you tried using a regular Catch Hook trigger instead of a Catch RAW Hook?

 

Some options:

  1. Use multiple Formatter > Text > Split steps in the Zap
  2. Use 1 Code step
  3. Try using OpenAI Send Prompt to do the parsing followed by a Formatter step to separate the results

@carnegiehighered 

Give this JavaScript Code a try.

 

CONFIG

 

CODE

let Set = JSON.parse(inputData.Set.replace(/\n/g,"").replace('",}]','"}]'));

output = {Set}];

 

RESULTS

 


Thanks Troy - that JS worked great!