Jump to content
  • 0

Triggered action on insert: Get 'GUID' type of inserted record to update other table.


Gilmay

Question

Hi,

Is there any way to get the value of a GUID (table field) of an inserted record in the main table and insert this to a child table?   I want to do this in a triggered action on 'insert data' event on the main table.

Issue: The field in the child table remains empty after the action has been triggered. (other fields are inserted just fine)

I suppose this is because the record hasn't been written to the main table yet when the triggered action is run, so the GUID does not exist yet.

Is there any way I can work around this?  

Thank you.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hello @Gilmay,

If you want to insert data into a child table based on inserting data in the parent table, selection from #inserted should work.

On my side, the ID value generated automatically when the new record is inserted is passed by the Trigger successfully. 

Could you share a screenshot of your Triggered Action? 

 

Q37BzLW.png

Link to comment
Share on other sites

  • 0

This is an old post, but I have what I think is a similar question, except I'm using Tasks not Triggered Actions. I am using a task to update data from a child table to a parent table, but I also do not have the primary key ID in the parent table until a new child table record is inserted, because it's a participant registration table. My parent table is a participant tracking table, that issues participant IDs for unique participants (no duplicates, updates data based on new records in the child table that have updated data using tasks). I have some data pages running on the Participant_tracking_tbl, and I need a formula field that exists in my child table to be copied over. I am using tasks, and this works for all the other fields I have copied over/updated, except for formula data types. I am assuming it is a similar issue because these need to use #inserted or the parameter [@field:InsertRecordVariable], but I can't figure out how to do this in tasks since I am updating records that already exist and were not just inserted. Any ideas? Thanks!

Link to comment
Share on other sites

  • 0

Referential Integrity  https://howto.caspio.com/tables-and-views/relationships/relationship-settings/ Make sures that a record can only exist in the child table if it has a properly defined parent record from the parent table.

Values in the #inserted are yet to be recognized as a record in the parent table since it will only be officially included on the table when the trigger ended. Before that, if the trigger itself tries to insert it in the child table, the referential integrity will block it and will then cause the error which will prevent the record to be inserted on the parent record as well.

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