Jump to content

Search the Community

Showing results for tags 'trigger'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • Caspio Apps for Ukraine
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

  1. I have a trigger that updates data on insert. I want that the number value be inserted in a text field, but I am having a mismatch error.
  2. I am trying to add via an Insert trigger a second row of data, based on the first row of data which is inserted by a trigger associated with another table. The Awards table has an start date and end date of the project, and on insert creates the first milestone in a Milestone table, based on the entered start and end dates for the Award. On insert of the first milestone, I would like to add (if at all possible) a second milestone if the remaining period for the period is bigger than 12 months (which is calculated in a formula field in the first record). I get a "Triggered Action cannot be enabled because it exceeds maximum nested level of 1" Error message. Any help appreciated
  3. If any of you uses RICH text editor for user inputs, you will notice that the actual data in the table contains HTML tags that describes the format used with the input. Ex. Will have the following data in your table: If you want a "clean" version of this text you can create a trigger/task that will remove the HTML tags. You can copy the Trigger below: The "formatted_txt" will be the field that uses the Rich text editor and the non_formatted_txt_trigger will contain the "clean" text version. Rich text editor will convert < and > to their entity name which are &lt; and &gt; and a "Non-breaking space" will be converted to: &nbsp;. The following blocks will replace this entity name to their actual value.
  4. I'm looking for information about the "expression" feature within triggers. I have not been able to find anything other than a reference to expression aliases in the Caspio Bridge 12.0 release notes. https://howto.caspio.com/release-notes/caspio-bridge-12-0/ " Expression names can now be renamed for easier reference in other areas. " " When saving or validating a Triggered Action, incomplete expressions in a SELECT block will be automatically removed. " I discovered the feature when working with a select statement embedded in an If statement. I assume these expression alias can be used elsewhere in the trigger code. Unfortunately, I have not found a means to use them. I created the following in an attempt to figure out how to use the "expression" feature. The IF block passes validation. I saved it along with additional code that modifies the inserted record (see below). Caspio doesn't complain about the simulated no operation (NOP) I created by using an IF 'exists' comparison for select statement return value This is a far as I have been able to reverse engineer the "expression" features. I have tried to access the alias (Var1, Var2, and Var3) elsewhere in the trigger withing many different contexts. I tried within the IF and THEN clauses where they are defined. I tried within subsequent Update and Select statements. etc..... Use Case I have a table that tracks eight different topic scores and an award for each topic by person. Awards qualifications for each topic are based on several factors (topic, score, when scored, gender, and age). The scope and qualification factors for each award are contained in a reference table. I implemented the triggers needed to identify and update or insert the correct the awards. It works as expect. A different qualification/criteria row may apply to identify the correct award for each topic for any person. Without going into all of the details you will not be able to identify whether or no the data has been properly normalized. You will have to trust me that it has been. Besides, I have other use cases that would benefit from variables. There are ten large Update statements used to the identify the award for each topic as well as updating summary awards in another table. The logic is complex enough along with the size of each update statement that maintenance of the code will be cumbersome and error prone. In fact, I haven't yet combined them into one update and insert trigger. I am concerned about perfomance due to the number of select and join statements. I would rather clean this up using something like variables before deploying them in one update and insert trigger. Ideal Solution Ideally, I could use variables to gather the criteria based on context for the person and use them within subsequent IF statements. This would significantly shorten the length and complexity of the trigger. Based on my reading of forum posts, Caspio help documentation, and viewing of YouTube videos I am nearly certain that triggers do not support variables. Except that maybe "expressions" within triggers could solve my problem. An Example I included the following to help the reader better understand the ideal solution that trigger "expressions" may solve. The following test uses dummy columns to hold values for use in the trigger. I think this is a dangerous kludge. I am not using this method in my production triggers. For example, three dummy columns called "ShortCountryCode", "NumbersTests", and "TextTests" were added to the table. TextTests is assigned the value from the CountryCode field in the first Update statement. It is used in the next Update statement as part of a concatenated string to update the ShortCountryCode field. TextTests is assigned the string "SumeGamaa" in the last Update statement. The NumbersTests column is used to execute the trigger from the datapage. Ideally, variables would be used instead of dummy columns. Here is the entire trigger with the test "expression" code. The IF statement that uses three expressions is not used in the last three Update statements. Note that Caspio doesn't complain about this trigger. I have attached the table and a datapage I used for my testing. The data is public domain that I downloaded from https://www.kaggle.com/ sb_dp_internet_country_codes_2018-May-13_1706.zip sb_t_internet_country_codes_2018-May-13_1705.zip
  5. I am having trouble reusing the table variable. It is supposed to be inside the loop so that I can send a table of related records in the send email. I understand the cause of the error is because I put the table variable assignment within the loop but is there any way to get around this? Here is what it looks suppose to look like: PS. sorry for that overly redacted sample.
  6. I am trying to configure SMS action in trigger. But upon testing, it does not work. Below is a screenshot. Any help would be appreciated.
  7. I have a use case where I only have the users birthday and I would like to get their age as one of my Fields on my users table. To achieve this, I created a trigger that will compute the age of a user when a new records is inserted or an existing record is updated. Trigger: Output:
  8. Hi, I have a table that I need to update records related to the ID value when a new record is inserted. When a new record is created a field called 'InvoiceID' stores (via parameter passing) a value. That value might be used multiple times in the table (for example, this is a Payments table linked to an Invoice table. The InvoiceID (unique- one) from the Invoice table is stored (many) in the Payments table for each Payment record for the same invoice. So for 5 Payments records there might be InvoiceID=2 used 3 times and InvoiceID=4 used 2) . When a new record is inserted to the Payments table I need the trigger to look up all other records in that same Payments table with the same InvoiceID and update them. I tried using the Where tabs with Field=InvoiceID Equals Field=InvoiceID but the trigger doesn't work. If I manually put in a number for the 2nd InvoiceID to test it the trigger does work. So the issue is the trigger being able to match existing record's InvoiceID value with the submitted/inserted record's InvoiceID value and update them. Does anyone know how/if this can be done? It seems like it should be simple so I must be missing something basic..
  9. I had this workflow that a user will enter Names in one text filed separated by a "," and that input would be inserted on a separate table but 1 name per column. To solve this I created a small Trigger that will separate all inputs and insert them to a different table. The trigger above can also be modified to fit other "separator".
  10. Hello everybody I'm trying to make a trigger which send a email with only the exactly data what has been updated in a details datapage. For example: - if the price has been updated send "new price: updated_price", - if has been updated price and name send "new price: updated_price, new name: updated_name", My problem is that it send a email for each updated column of the row instead of only one email. There is a mode to avoid such thing? If this is something I have to do in the details datapages how i could do it?
  11. I have a rather complicated task that I'm trying to execute. This may take a bit of explaining. It references three lookup tables and two other tables. The point of this task is to set a number of days required to complete a specific task (Engineering, Welding, etc.) in a project. These days vary based on the unit size and type. Here is part of the table that I am using for reference so that you can understand what I'm working with. So for a job making a "Non Jacket Bin" that is under 500L, the Engineering task should take 5 days and the Weld task should take 10 days. Here is the task as I currently have it. So the table that this is updating is specifically for tracking the number of days required to complete each operation for a job line. It is connected to the job lines table via a Line Number. Right now I only have it updating the days it takes in Engineering but I will add Weld and more. That's why I have the joins in the Update statement and not the select - just to avoid redundancy. So first, it joins the days line number to the lines line number. Then it takes the unit size and joins it to a lookup table. This lookup table is used to convert the size to an integer. In the lines table it is written as "100L" so this join just allows for a value "Liters" to be used later which removes the L. The next join connects the Unit Type to another lookup table which will be used to find the general category the type is in ("Bin" rather than a code like "BINX"). Finally, this is joined to a table that is similar to the one pictured above. Here is part of that table for reference: (The days are the days before the ship date) The Unit Size refers to anything that is less than or equal to that number. Thus, why my join is on Liters >= Unit Size. I then sort the select by the unit size ASC which should connect Liters to the smallest Unit size without going over. Instead, what I get is all units, regardless of size, assigned the smallest days. What am I doing wrong? Any help would be appreciated!
  12. Hi there, I need to create a trigger that sums different column values per user. I have multiple users on a table (below) and would like to on another table insert sum the number values of each a_user per column and insert it into another table as a combined history. ie user1: 106 | 60 | 73 user3: 96 | 45 | 71
  13. So I'm trying to make a trigger so that when new data is inserted/updated in my table it checks that the address doesn't match any existing addresses for that Customer and if not, it stores the address in a lookup table for easier inputting in the future. This is the trigger I set up but it isn't working. Anyone know a better way to do this?
  14. I need some help figuring out the issue with my trigger. Currently, it inserts nothing into my tbl_ggl_job_lines_dates table. In previous iterations, it has inserted duplicates of the same record. What it does is make a line from the feeder table which is this #inserted table. Then it should use this trigger to create a matching line in the dates table with some info filled in from the feeder table. The feeder table only has the Job ID which can have many Line Numbers within it. The dates table only has the Line Number. The #inserted table has both. Thus the two joins. The where statement is supposed to ensure that I don't pick up duplicate records but I'm not picking up any records. Any help would be appreciated. Thanks!
  15. I'm working on a trigger to create a certain number of lines based on the quantity specified upon submission. Basically it's one table that feeds another table. Here's the trigger. Variable i starts at the First Serial Number specified upon submission and iterates while i is less than the serial number plus the number of lines. Each line has a unique incremental serial number in the format JOB-01 where 01 is the serial number and JOB is the job ID. That's what the concatenate statement should do. This is the error I'm getting which doesn't make any sense because this should just be inserting new lines right? It shouldn't affect any vast number of records... Please help!
  16. I need help debugging a trigger. The whole trigger is very big because it's all the actions that need to happen when any data in the table is updated. Trying to avoid too much cascading. But here's what's relevant to my issue: So I have two tables, one for current notes and one for the history of all notes ever added to a job. In my job table, I have a Notes column and a New Notes column which is perpetually blank so that new notes can be added. What this trigger is supposed to do is insert the old note into my history table along with the Job ID and who submitted it. Then, the update should put the new note into the Notes column and empty out the New Notes column. What actually happens is the second part of the trigger works perfectly and adds the new note to the notes column but something goes awry with the first part and it adds 2 new rows to my history table with the note as completely blank and it also changes any pre-existing records with the same Job ID to be blank ???? I am at a loss. Please help!
  17. I'd like to be able to timestamp when each individual column is updated. Basically, when column "x" is updated, the column "timestamp_x" is updated with the time "x" was updated and when column "y" is updated, column "timestamp_y" is updated with the time "y" was updated and so on. Is there a way to do this with a trigger? Or within the datapage with HTML or with a calculated value? Let me know if you know a solution! Thanks!
  18. I created this trigger so that when I insert a new line into this table, it automatically creates a matching line in another table (if the unit type is not "FREIGHT" or "OTHER"). For some reason, it ran perfectly the first time I added a new line but now when I enable it and try to add a new line to my table, it freezes the page and does not allow me to add a new line to the original table. The page turns unresponsive. Here is my trigger. Can anyone help me identify the issue?
  19. Hi there, I am relatively new here with my first post. I am busy figuring out trigger actions which I have the basics down but struggling with something: I have 3 tables: 1. user_info 2. trading_results 3. user_history I need a trigger action to insert newly captured data from trading_results (date, growth in %) to user_history applying it to all active users (tick box) from the user_info table.
  20. I have a table that I have a lot of information coming into using a multi step form . There are parts of it I want to go into a new table. I created the trigger, and the new row is created when the form is submitted but the actual data isn't going into the table. I don't have a clue of why its not going into the table see the photo of the trigger and the table showing blank rows. Any help would be awesome. Thanks.
  21. Hi, I'm not sure if this is possible but I need to set up a trigger to copy multiple records from one table to a) the same table and b) to another table. This is basically so a user can draw from old records for new projects without having to re-enter all the data again. The user would be doing this via Bulk Edit (selecting multiple records and updating a field for them all). There are a couple ways I thought this maybe could be done: 1) having Bulk Edit update one field ('copy_me') to 'True' and then a trigger that runs 'On Update' using Where 'copy_me'= True to select the records to copy. Then run duplicate those records (but not all fields, only some) on the same table OR into another table. After that the next step in the trigger would be to change 'copy_me' to False Where 'copy_me' was True so that the record was no longer 'triggerable'. 2) use a separate table to store, in a new record, the Id's (integers) of each record that's been chosen via Bulk Edit and then running an 'on Insert' trigger that Joins those Id's (they're in one text field, comma separated) to the main table's Id's and pulls various fields to copy them into a new table. I currently have the first half of this scenario set up (storing multiple record Id's in a separate table's text field via Bulk Edit) but don't know how to create a 'duplicate records' trigger for it. If anyone knows the specifics of getting a trigger like this to work-- or a better way to copy multiple records after they've been updated via Bulk Edit-- I'd really appreciate the help.
  22. Will trigger be executed in a table when new record is inserted via Zapier?
  23. Hello, I'm new to Caspio. I have an Update Form with a calculated field called "Total_Percentage", that takes the values from other fields. Code below: Isnull([@field:PointFactor_Duties_PercentDuty1],0)+Isnull([@field:PointFactor_Duties_PercentDuty2],0)+Isnull([@field:PointFactor_Duties_PercentDuty3],0)+Isnull([@field:PointFactor_Duties_PercentDuty4],0)+Isnull([@field:PointFactor_Duties_PercentDuty5],0)+Isnull([@field:PointFactor_Duties_PercentDuty6],0) What I would like to do is to prevent users from going forward when their total exceeds 100%. I also, would like to show them, which field(s) is/are causing this field to go over the threshold of 100%. The rules section is not conducive to this goal, as rules section is limited. Triggered action section forces me to either email or text the users if their total exceeds 100%. I don't want to do this, since the whole point is for users to correct errors immediately. Is there anyone out there who can impart me a script or two to help me? SQL or javascript that would work with Caspio. Thank you so much. Emme
  24. I am creating an on insert trigger for my table but upon testing, I got this error. Modified the trigger to a simple insert like this: However, the error still persists. Does anyone encounter the same issue? Any help would be greatly appreciated.
  25. Is there a way to preview HTML email in trigger without enabling it and sending the email?
×
×
  • Create New...