Help

Updating values in Linked records using a script

Topic Labels: Automations
Solved
Jump to Solution
1427 8
cancel
Showing results for 
Search instead for 
Did you mean: 
CharlieMullin
7 - App Architect
7 - App Architect

We perform record review for the assets we have in our base, around 300 days after the last review date was entered for the asset. These assets are in the LMS Content table, which has linked records back to the Assets table.

Rather than have the reviewer go to the the Assets table to update those linked records, I’d like to automate it so some of the linked records get updated with the same new date value.

In the Assets table, there are linked records back to the LMS Content table, here I want to update some of those records based on a condition.

Here’s a bit more about the desired workflow:

I want to update linked records when a value in the Last Review Date field of the LMS Content table changes. 

For each linked record, from the Assets table where its Asset Type value = “Video”, update its Asset LR Date to the same value just updated in the Last Review Date field of the LMS Content table.

Then, for each linked record from the LMS Content table, where the value in the LMS Content field in the Assets table = value of the Asset Name field in the Assets table, update the Last Review Date field to the same value that had been updated originally in the LMS Content table.

Maybe this picture helps explain what I want to do:

CharlieMullin_2-1722018716520.png

 

 

 

 

 

 

1 Solution

Accepted Solutions

re: Find Record action

Ah you'll need another condition where "If LMS Content = Airtable record ID"
---
re: Update record action

Yeah, you need the "Record ID" field to be selected like this

Find record -_ Update record.png

Your "Asset LR Date" field also needs to be updated with the "Field Values" -> LR Date field from the "Find Records" step

===
re: Updates to the kinda linked LMS Content records

Ah I see!  Hm, yeah that makes sense.  Should be doable!

If you could provide a read-only invite link to a duplicated copy of your base with some example data I could try to set this up for you real quick!  If you could provide clear examples of which records should be linked to what / how they're to be updated that would be really helpful

https://support.airtable.com/docs/adding-a-base-collaborator#adding-a-base-collaborator-in-airtable

See Solution in Thread

8 Replies 8

re: I want to update linked records when a value in the Last Review Date field of the LMS Content table changes. 

For each linked record, from the Assets table where its Asset Type value = “Video”, update its Asset LR Date to the same value just updated in the Last Review Date field of the LMS Content table.


Hmm, I don't think you need a script for this bit probably?  Have the automation trigger when "Last Review Date" is updated, and then have a "Find Record" action that'll look through Assets for records linked to the triggering record and where the Asset Type = "Video", and then update their "Asset LR Date" accordingly

---
re:  Then, for each linked record from the LMS Content table, where the value in the LMS Content field in the Assets table = value of the Asset Name field in the Assets table, update the Last Review Date field to the same value that had been updated originally in the LMS Content table.

I'm not too sure I follow for this bit, sorry!  So the records that need to be updated are in the LMS Content table, and the way we're identifying them is by seeing if they're linked to the same Asset record that was just updated?

Hi Adam, thanks for your thoughtful response. Yes, I agree that my first item can be created in an automation, although I have a question about the configuration for Find Records. So, that first. 

Trigger seems to work fine:

CharlieMullin_1-1722103661673.png

 

My Find Records config tough is returning 10 records instead of the one I expected, which was found by the trigger?. I think my condition isn't right. 

CharlieMullin_0-1722103491571.png

What's the conditional logic needed to find linked records for just this LMS Content record, found by the trigger?

My Update Record config isn't right, either:

CharlieMullin_2-1722104129618.png

Any guidance you can provide would be really appreciated. (Don't know why I find the automation interface confusing...)

As for the second item, I did a poor job of explaining all that. So, more information:

In our LMS, we create Courses and other training items. A Course can include a video page where we add a video. (These videos are sourced in Wistia, so we specify a Wistia ID to provision the video. This means that updates to a video that then replace the video in Wistia are all updated in the LMS where ever that video is.)

Our content development process regarding new videos is to add the video to the LMS in an LMS Content container whose type is video. In other words, we have content in our LMS that includes both Course as well as Video content. It may be simpler to refer to these as modules - as in we have Course modules and Video modules. So, when we add a video to a course (in a video page) by specifying its Wistia ID, that video now exists in two modules: a Course module and a Video module.

Our asset review process is triggered when a record in the LMS Content table is due for review. Records that are in the Assets table are not part of this review process triggering - we only update records that are in the LMS Content table.

Remember I just explained that we add new videos to an LMS Content module that has the type Video. Because it's in the LMS Content table, it, too, has a Last Review Date field that triggers a review process.

Whew! So, that means that when we are reviewing a Course, and that Course includes a video, we want to also update that video module in the LMS Content table so that that record won't get needlessly reviewed later because we just reviewed that video in the Course. Since the Video module is NOT belng linked to in the Course, (just the video in the Assets table is being linked to) we need a way to update the Video module in the LMS Content table automatically.

Hence, my idea to traverse the LMS Content table and use the Asset Name value to find the associated LMS Content record becae we always use the same name for the record in the Assets table and LMS Content table.

All of this seem really convoluted to me so any ideas would be appreciated.

Thank you! 

re: Find Record action

Ah you'll need another condition where "If LMS Content = Airtable record ID"
---
re: Update record action

Yeah, you need the "Record ID" field to be selected like this

Find record -_ Update record.png

Your "Asset LR Date" field also needs to be updated with the "Field Values" -> LR Date field from the "Find Records" step

===
re: Updates to the kinda linked LMS Content records

Ah I see!  Hm, yeah that makes sense.  Should be doable!

If you could provide a read-only invite link to a duplicated copy of your base with some example data I could try to set this up for you real quick!  If you could provide clear examples of which records should be linked to what / how they're to be updated that would be really helpful

https://support.airtable.com/docs/adding-a-base-collaborator#adding-a-base-collaborator-in-airtable

Thanks Adam!

I'm working on implementing what you clarified for item #1 and will have a base to share with you in a few days (or sooner.) for item #2.

Adam, please advise the best way to provide you with a link to the testing base. I'll also include more information about the base data.

 

CharlieMullin
7 - App Architect
7 - App Architect

Hey Adam, I generated the link and just emailed it to you, along with pertinent info about the base. Let me know if that works for you.

Thanks!

Hi Charlie, just closing this thread off as we took our conversation to email; glad I could help!