Create a trigger that is triggered when a field in my record changes

Hey guys.

I want to create a trigger that, when a record that has a “status” field changes to the value “finished” for example, will send the value of my “project_code” field via a post request to my platform’s URL.

Can I do that using a webhook?

Any clarification needed, please tell me. Thanks!

Hey @fernando.nakandakari can you help here?

Hey @Espeschit

There are two ways to do that: No-code tricks or low-code triggers.

  1. Tricks:
    This is the easiest way to do it. Basically, you’re going to create an automation with a trigger (condition) and an action. In this case, when Status becomes Finished, then Send information to a Webhook.

To do that, go to the table you wish to create the automation on (I’m imagining it’s Projects) then click on +Automations to create a new trick:

image

The trigger you’re going to create is this one:

image

And then you’ll fill in the conditions:

Then you’re going to choose this action:

image

And you’ll be able to make an API call with the info from your own record.

If you set it up right and save this trick, every time a record goes to status = Finished, it’ll send the values you set up to your platform’s URL.

  1. Low-code
    If you have access to the low-code area, this is a good way to do it if you want a lot of customization and flexibility (though, in this case, I feel it’s not necessary).

In the low-code area, I can go to the page of the table Projects and create a trigger for that table.

In this case, I’d set the trigger for After a record is updated:

Then write a code to check if status has changed to Finished and, if so, make the API call:

if($objectNew['status'] != $objectOld['status'] and $objectNew['status'] == 'Finished'){

$url = "https://example-url.com";

$data = array(
   "project_code" => $objectNew['project_code']
);

$payload = json_encode($data);

$response  = Jestor.curlCall($url,array(

CURLOPT_HTTPHEADER => array(

'Content-Type: application/json'

),

CURLOPT_POST => true,

CURLOPT_POSTFIELDS,

CURLOPT_POSTFIELDS => $payload

));
}

For a better understanding of what’s happening above, these links can help:

Hope that helps!

2 Likes