# Webhooks to handle field validation?

**URL:** <https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657>\
**Category:** Webhooks\
**Tags:** fields\
**Created:** [June 11, 2021, 10:46pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657 "2021-06-11T22:46:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico.vandenbosch](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/nico.vandenbosch/32/4949_2.png) [@nico.vandenbosch](https://community.shotgridsoftware.com/u/nico.vandenbosch)\
**Post date:** [June 11, 2021, 10:46pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657/1 "2021-06-11T22:46:53Z")

</div>

We’re just dipping our toes into the new webhook feature and I’m wondering if we could leverage these to handle some simple field validation. Basically, the idea would be to provide immediate feedback to the user on creation or edit of an entity if a field didn’t match some regex. I imagine this is only possible if the http response could somehow trigger a pop-up window of some sort, but honestly I’m not enough of a web guy to know if this is technically possible or if this simple beyond the capabilities of http and webhooks. Any thoughts or success stories out there of people using them in this way?

---

<div class="post-metadata">

**Author:** ![daigles](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/daigles/32/1072_2.png) [@daigles](https://community.shotgridsoftware.com/u/daigles)\
**Post date:** [June 14, 2021, 2:46pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657/2 "2021-06-14T14:46:45Z")

</div>

Hi Nico,  
By design, webhooks are triggered after the fact (e.g. when the creation or update of the entity has occurred).  
So you cannot rely on webhooks to catch events _before_ they are committed to the database.  
Not ideal, but one thing you _could_ do is have a webhook that validates the name when the name was changed (or after the entity is created) and send a notification (ex: through Slack) when it does not fit the regex so users can fix it after the fact.

---

<div class="post-metadata">

**Author:** ![nico.vandenbosch](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/nico.vandenbosch/32/4949_2.png) [@nico.vandenbosch](https://community.shotgridsoftware.com/u/nico.vandenbosch)\
**Post date:** [June 14, 2021, 5:17pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657/3 "2021-06-14T17:17:36Z")

</div>

Understood, at best web hooks or event triggers can only validate and notify after-the-fact. The question I’m specifically positing is whether web hooks offer any added advantage in that they might be able notify the user immediately/directly in their browser via a pop-up as opposed to some external notification system like email or slack?

---

<div class="post-metadata">

**Author:** ![daigles](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/daigles/32/1072_2.png) [@daigles](https://community.shotgridsoftware.com/u/daigles)\
**Post date:** [June 15, 2021, 1:04pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657/4 "2021-06-15T13:04:16Z")

</div>

Oh, I see what you mean…  
At this time, it is not possible to use the ShotGrid app itself as a webhook target.

---

<div class="post-metadata">

**Author:** ![nico.vandenbosch](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/nico.vandenbosch/32/4949_2.png) [@nico.vandenbosch](https://community.shotgridsoftware.com/u/nico.vandenbosch)\
**Post date:** [June 15, 2021, 5:34pm UTC](https://community.shotgridsoftware.com/t/webhooks-to-handle-field-validation/12657/5 "2021-06-15T17:34:37Z")

</div>

Arriving at that conclusion myself. Current plan is to run validation as an event plugin instead and generate a linked note on failure.
