Webhook clears request body when request body is an array

I have created a webhook that receives update events from another service. The specification for the request body of these update events can be simplified to the following:

[
    $eventJSON1,
    $eventJSON2,
    ...
]

My goal is to loop over the request body JSON array and handle each event, however when testing with some test data, I noticed that the webhook trigger will fail to pass any request body that is an array of JSON objects, despite this being valid JSON.

Trying to Query the request body throws an error since The required parameter "JSON" is missing, and trying to add the request body to a table or use in a JSON template shows that it’s just empty.

As an aside, the Test Data section doesn’t show an array of JSON objects to be an invalid request body if this is an intentional choice by the Glide team

That’s weird. If you use a manual trigger instead, and specify the input to be JSON, then use your JSON in the test data, does that work?

It still seems to treat it as if there’s no test data.

I think you need to wrap the json data in an object, as such:

{
  "events": [
    {"a": "string a"},
    {"b": "string b"}
  ]
}

Can you do that where your webhook is triggered and then try again?

If you loop directly on the body instead of doing an extra query step, does it work? What do you have in that Query step?

The query step is only there to grab a row to set the column value inside the loop, the loop is trying to run on Trigger > body

1 Like

While this does work, the issue is the data coming into the webhook from is formatted:

[
    {"a": "string a"},
    {"b": "string b"},
    ...
]

I have tried creating a JSON template that is formatted like:

{
    "events": $webhook_body
}

# $webhook_body = 'Trigger > request body'

But the issue is that when a webhook trigger receives a JSON array it completely removes it before the workflow even triggers

Where did you create the template? Before the webhook? Because you could also add the template after the webhook, and use the output from the template instead of the trigger.

In the image provided I didn’t use the template, but here’s some images of me using a JSON template.

Template config

Loop config

Trigger when running workflow

Template when running workflow


Loop when running workflow


Creating a JSON template after the webhook doesn’t work. The issue is that the Workflow Trigger is ignoring any input data if it’s a direct JSON array; it is not passing any data to any other actions in the workflow and acts as if it has no input at all.

I am unable to create a template before the webhook and change how the incoming data is formatted, the webhook is triggered by a third-party service, external to Glide.

1 Like

Sadly I think you are correct here. I tried reproducing this and it seems a valid JSON array as a manual input doesn’t get read at all.

Can you submit a ticket through the bottom right icon in your builder?

1 Like

I am actually unable to submit a ticket for some reason.

I’ve been looking at this guide, and we have an enterprise account, but the (?) button to submit a ticket isn’t there? I don’t have any any chrome extensions installed, so there shouldn’t be something blocking page elements. But I also have no memory of ever seeing the (?) icon since I started using Glide a month ago. Is there a direct link or webpage for creating a support ticket?

1 Like

@r_avo - We got your support ticket and are looking into it. I also resolved the issue where the (?) support icon wasn’t showing up in your team. We’ll get back to you via the support ticket next.

2 Likes