Skip to main content
Question

Updating Fields in table when new record is created in another table

  • September 8, 2023
  • 0 replies
  • 416 views

Hello, 

I am looking to set up a trigger to update several fields in my Employee table when a new record is created in my Position History table. My Position History table holds records for current and previous positions for the related employee. The fields I'm looking to update in my Employee table are department, unit, location, and position. Essentially, I would like the most recent position record added to act as the employee's current position. 

I have a relationship set between the two tables and have tried adding Quickbase actions to modify the employee record, but nothing seems to be working. 

Please see screenshot of my table set-up. 



------------------------------
Erika Brown
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+1

This should be possible with actions, you need to set an action from the Position History table so that when a new record is created it copies the value from the relevant fields in that table into the relevant fields in the parent record. Maybe if you can upload a screenshot of the action that's not working I can see if that's been set up incorrectly.

You could also try to use a Pipeline, but as long as you don't already have 10 actions connected to that table, they should work. Make sure the action is enabled as well, when you see the list of actions for a table, make sure it has a green tick next to it. 



------------------------------
Personal Tax Team
------------------------------

MarkShnierYou
Forum|alt.badge.img+24

Erika,

In this use case I don't feel that all the fancy tools like Pipelines, jinja,  webhooks,  Automations Actions, or Formula Queries and all that jazzy stuff  is the way to go. The right way to go here is old school Relationships and in this case  building a Reverse Relationship. The advantage of this is that it will work on all your historical information and will be rock solid and they can never fail to fire.  

OK here goes. We have a relationship where one employee has many Position Histories.

Summary field of the maximum of the Effective Date of the position history (I'm assuming Position History has such a field..  Call it [Date of Most Recent Position].

Look that field up down to all the Position History records. Great, now each Position History record has the opportunity to know if they were the lucky one that is the most recent effective date. 

Make a new summary field on the relationship for the maximum of the Record ID subject to the filter that the [Date of Most Recent Position] equals the [Effective Date].   Call it [Record ID# of Most Recent Position History]

Great, now make it a new reverse relationship where one position history has many employees. Yes I know it sounds backwards and that's why we call it a reverse relationship. When building the relationship when you go to choose the reference Field choose the field [Record ID# of Most Recent Position History.

Now simply look up all the fields that you need from that most recect position history into your employee record, such as department, unit, location, and position.



------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------