Jump to content
  • 0

Send email once


Kuroshi

Question

Hi I need help with setting up my Trigger.
 
I wanted to send out an email only once. 
 
Currently, I have a table with Two Checkboxes (I plan to have more)
 
These checkboxes serves as the process of hiring.
 
So I have one checkbox to send out email once someone is up for interview, and another one to send email once the employee is hired.
 
Every checkbox has a different email template. 
 
Now, I set up this trigger.
The problem is - every time I check the second checkbox, it sends out the email for the first checkbox instead. 
 
Any help is appreciated.

Screenshot_4.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

You can try out this Trigger I created.

Screenshot_6.thumb.png.edc474b4f6e4b5c723fccf5c9a2d7a55.png

 

If I''m not mistaken, you are trying to send an email upon update perhaps?

 

Once updated, the system will send out an email depending on the checkbox changed.

So I created this trigger, and the idea is to combine two tables, the INSERTED table, and the SELF table. This is to compare Previous Values and the NEWLY Updated Values.

 

Now if you look at the SELECT Statement inside the trigger, I created an Inner join.

Inside my WHERE Clause, I put in the conditions:

1) IF Checkbox1 is not equal to INSERTED Checkbox 1,

- which is an indication that the field has been updated.

AND

2) IF the  previous Checkbox1 is equal to FALSE. 

- this indicates that the checkbox was previously false, and if the 1st condition is true, only means that the checkbox has been changed to TRUE.

Additional Note: You can also use the condition if #inserted checkbox is true. (Either would work just the same)

 

This way, you can ensure that when the other checkbox is checked, it will not satisfy the 1st Send Email action, since the 1st checkbox is not updated on the process of updating the other checkbox.

 

More about trigger on this link: https://howto.caspio.com/tables-and-views/triggered-actions/

 

Hope this helps.

 

Glitch

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...