Best answer

Null filter / webhooks

  • 23 June 2020
  • 2 replies
  • 2059 views

Hey, did you managed to get this working? I’m stuck with a webhook answer like this:

{
"data": {
"completed_at": "<Some date here>"
},
"updated_from": {
"completed_at": null,
}
}

The whole `updated_from` is not there if the update does not impact the completed_at. The only option here is to filter on `data__updated_from is blank` but then it’s triggers for way more than I would like.

icon

Best answer by steph.n 30 June 2020, 04:22

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 +8

@Calyhre ,

Thanks for reaching out!

I am escalating this to our Support team as they can take a closer look at your webhooks and configuration. Once there is a resolution, we’ll circle back to update this thread in an effort to help other users. 

Sit tight and someone will be in touch just as soon as they can!

Userlevel 7
Badge +8

Hi @Calyhre - That’s great that you were able to resolve the issue with our team. Here’s the solution in case anyone is looking for it: 

I think we've hit an impasse here - our system does not differentiate in any meaningful way between a value that is blank or nonexistent. As far as we're concerned, blank and nonexistent both mean that the data doesn't exist, so we don't have any way of spotting the difference.

The problem is that we're parsing the data in the backend before we hand it over to you. There is a way to prevent the parsing from happening and get the raw content of the hook using the "Catch Raw Hook" trigger:

e95ecd1a7157885ee58b4d3dc7d563d9.png
(view larger)

If you were to do that, I believe you could use a filter to see if the entire body contains the text "updatedFrom__completedAt" or something similar - that should achieve what you're looking for. The downside to this is that you now have an unparsed, raw request that you would need to parse yourself. I assume you could do this using a code step, but unfortunately that's where my expertise stops. I don't know what code you'd actually need to do this.

So, you could definitely give that a shot! I wouldn't be able to help with the code step, but it would likely get around the roadblock we're currently experiencing. I've also added you to the feature request to provide access to the raw hook in addition to the parsed fields, which would solve the problem as well. We'll let you know if that becomes a reality.

I wish I could be more helpful here, but please let me know if you have any other questions!