Jump to content
  • 0

View table not getting updated


EmmePGN

Question

I have 2 tables joined in Views. I tried  both inner and outer join for a field EEID which is an auto number in the parent table and an integer in the child.

But when I enter a new record in the parent table, the record doesn't get inserted into the child table.

I also tried relating the two tables via relationship setup. I tried both  "inner" and "left outer" connections and "one-to-many" for the parent table.

None of these work.

Lastly, I already have a trigger setup in the parent table and from what I understand, you can only use a trigger to update one other table.

Is my understanding wrong about triggers?

Can anyone please help with the relational setup?

How can I arrange it so that whenever I enter a new record in the parent table, the child table(s)  will have the same record (e.g. EEID) ?

 

Emme

 

 

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @EmmePGN

Triggered Actions allow data manipulation, calculations and sending notifications by constructing application logic with a visual interface. They will be executed on specified events to perform actions on data in your tables, either insert, update or delete. 

 

Here is a sample Trigger that will insert a record to Table B upon insert in Table A.

trigger.png

 

You may check this link for reference: https://howto.caspio.com/tables-and-views/triggered-actions/

Link to comment
Share on other sites

  • 0

Views are like virtual tables, they do not have their own values, they just depend on the values of the tables that they are joining. So if the Views are not updating, it might be that the tables joined together are not updated or only one of those two tables is updated and the join is not made. Hence, not getting into the View. (Because the View did not find the foreign key identifier in the other table). This is, at least, what I understand about Views.

Regarding triggered actions, you can update two or more tables. You just need to put all update blocks/actions inside a single triggered action and make sure that there is no Triggered Actions on the other tables that may cascade (well depending on the plan, we can have up to 2 cascading triggers I think)

Sharing this article that might help: https://howto.caspio.com/tables-and-views/triggered-actions/#:~:text=to the trigger.-,Combining Actions,-A single Triggered

Link to comment
Share on other sites

  • 0

SOLVED!

Thank you all for assistance. I finally figured out my issues and what I now have, works.   The first thing I did was to calm my brains AND look at things from a 10K view.

I finally quit trying to combine two events in one trigger. I was forcing the Insert and Update events together in one trigger, which is not a best practice.  This can kill brain cells really quick.

So, I separated these two events into 2 triggers.  They now work perfectly well.  Yeayyyy me!

My first objective was to "INSERT" the new records to multiple tables after said new records are entered into the parent table (yes, they are relationally linked).

That first image has multiple tables getting their records from the parent table.  This block arrangements for the Insert trigger works really well.

My second objective was to "UPDATE" the records from the multiple tables  after they are updated from the parent table.  The block arrangements for update also works really well for me.

I thought I'd share my experience and I hope this helps others.  Lesson learned = "NEVER OVERTHINK"  BE SIMPLE.  Simple helped me.

I must add that the EEID, which is the trigger point is an auto number.  I defined a scenario that as long as EEID is greater than 0, things will be copacetic. 

Naturally though, EEID will be greater than zero when a new record is created.

Hope I make sense.

 

trigger_insert.jpg

trigger_update.jpg

triggers.jpg

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