Kuroshi Posted May 27, 2019 Report Share Posted May 27, 2019 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. Quote Link to comment Share on other sites More sharing options...
0 Glitch Posted May 27, 2019 Report Share Posted May 27, 2019 You can try out this Trigger I created. 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 Quote Link to comment Share on other sites More sharing options...
Question
Kuroshi
The problem is - every time I check the second checkbox, it sends out the email for the first checkbox instead.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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.