Best answer

Extracting payload Data from a trigger

  • 30 April 2021
  • 2 replies
  • 377 views

We have a trigger from Service Titan that is returning a large payload of data.  There are a number of custom fields that come in the payload and we need to extract one of the custom fields.  I haven’t been able to find much documentation on how to extract trigger data that is coming from another application as the start of the trigger.  We have to connect to the Service Titan tigger as Zapier is listening for the data from that connection in order to start the process.  (we have many customers we provide this service for and we have to conenct via the Service Titan App.  I would like some assistance on how I might be able to extract data from the returned payload sent from the starting Trigger. 

 

I’m trying get the value of Job Summary to Post in this example payload.  The Name and typeId values are always the same every completed job. 

 

campaign:

  category: null

  id: 4449

  name: Existing Customer

  modifiedOn: 2018-06-07T14:17:28.562021Z

  active: true

canceledHistory:

id: 36417267

active: true

status: Completed

jobNumber: 387972

customFields: 

1:

   typeId: 29901939 

   name: Are you or anyone in your household experiencing COVID19 symptoms

   value: No

2:

   typeId: 30818035

   name: Have you traveled out of state in the last 14 days? If yes, will you wear a mask when we get there?

   value: No, I have not traveled

3:

   typeId: 36119539

   name: Job Summary to Post

   value: No Heat

4:

   typeId: 31054963

   name: Verified Email

   value: Yes

 

icon

Best answer by Troy Tessalone 30 April 2021, 20:53

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +14

Hi @rfincke 

If you’re using the Webhook app as the Zap trigger, then you can try to Pick Off a Child Key as shown in the screenshot to help isolate the desired value.

Otherwise you’ll likely have to use a Code step to handle the isolation of the desired data points and value.

The Formatter > Utilities may have some options worth exploring.

 

 

Also make sure to reference the available help articles for each app…

Webhook: https://zapier.com/apps/webhook/help

Code: https://zapier.com/apps/code/help

Formatter: https://zapier.com/help/doc/how-use-formatter-functions

Userlevel 3
Badge +6

Hey @rfincke, hope you’re well, I just wanted to check in here!

Were you able to get things working based on the information Troy shared, or can we still help?

For this particular workflow, if we don’t want to pick off a child key here, you would need to use a Code step to build some scripting for parsing the data and converting it into the format you need. Then you can take the result of that code step and use it in any remaining steps of the zap.

The scripting itself for the Code step would be unique to your use case and how you want the data to be reformatted.

If we’re only interested in getting the data from Job Summary, I believe the Pick Off Child Key setting for the Webhook trigger that Troy mentioned would be the most straightforward solution here.