Jump to content
  • 0

Copy and update data from one table to another Tirggered Action


roattw

Question

Was using the info in ths post:  https://forums.caspio.com/topic/7807-copying-from-one-table-to-another/  but not working for the update portion.

Workflow is a DP that enters data into a table EM_Directory.  If certain conditions met some of those fields copied to second table EM_Alumni.  That first part of the trigger works fine.  But I also need any updates made to the address  field in EM_Directory to update in Alumni table.  But not working.

Have it set as below.  Top portion (the copy data from EM_Directory to Alumni table works fine (#1).  The bottom portion (#2) will not update the Home_address field in AlumniTable  if Mailling_address field changed in update/details DP.

Set to Run on Insert and Update.  It wouldnt let me add a second triggered action to this table using just the update.

As always, thank you!

 

trigger.thumb.jpg.de74e2cec88bffe25386f73f8fe8def3.jpg

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I'd highly recommend breaking it out into 2 triggers, 1 for Insert and 1 for Update. You are only allowed to have one of each type per table - so if you have the Insert and Update trigger enabled, it won't let you create another one of either type. You'll probably need to set this one to Insert and save it first, then create the update trigger.

Also, it looks like for the update portion, you are using an Insert block. This is creating new data, not updating existing data. If you are trying to create new data, it's only submitting Home Address and no other fields like ID or anything, so you'll probably either get an error or you'll get records where everything is blank except Home_address.

I'd keep the first section how you have it. Set the trigger to Insert only. Create a new Update trigger and put in the 2nd section, but with an Update block and not an Insert block (or an Insert block with the rest of the info to create a full new record).

Link to comment
Share on other sites

  • 0

Hi @roattw,

I agree with the approach suggested by kpcollier. 

You may try to use the design as on my screenshot.

The first Join finds the record with the same Entry_ID in both tables (EM_Directory and EM_Alumni ). 
The second Join finds the currently updated record in the EM_Directory table.

The condition in the WHERE clause checks whether the Mailing_address was changed. 

 

FhPCGbJ.png

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...