Duplicate/copy "Trigger webhook" with multiple parameters

Yes, but every use case is different of course. So what I did may not be directly applicable to your situation. But I can provide some general advice which you might be able to take and adapt.

The first thing to do is to define your JSON structure. The best way to do that is to open your favourite text editor and start typing :wink:

In my case, I needed to send a bunch of rows of data, so I used a very similar technique that I use for generating a HTML table, or a CSV export.

My JSON structure looked like this:

{
	"timesheets": [{jl}]
}

The {jl} part of the above is an arbitrary collection (a Joined List) of rows. The template for each row of data looked like this:

{
	"key": "{key}",
	"user-code": "{user-code}",
	"user-name": "{user-name}",
	"user-role": "{user-role}",
	"date": "{date}",
	"year": "{year}",
	"hours": "{hours}",
	"project-number": "{project-number}",
	"project-name": "{project-name}",
	"stage": "{stage}",
	"stage-name": "{stage-name}",
	"notes": "{notes}",
	"pretty-date": "{pretty-date}",
	"consultant-id": "{consultant-id}",
	"project-id": "{project-id}",
	"stage-id": "{stage-id}",
	"created-by": "{created-by}"
}

So the above went into a template column, and each of the {xxx} items was used as a replacement value. And then all the rows get combined via a joined list, with the end result being the screen shot that I shared earlier. And that’s what gets sent via the webhook.

The Parse JSON module will take just a single value, which is the JSON object that’s sent via the webhook:

You need to define a Data Structure that will instruct the module how to handle the JSON. The easiest way to do that is to use the Generator. Just copy/paste your JSON structure in, let the generator do its work, and then tweak it afterwards.

That’s really irrelevant here, as it’s specific to my use case. The important thing is that once you have successfully parsed the incoming JSON object, you can then access the data within and use it as you need to in subsequent modules.

2 Likes