Help

Need Assistance Creating a Script for Updating Records from Form

Topic Labels: API Scripting
752 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Karen_Reittinge
4 - Data Explorer
4 - Data Explorer

I have no experience creating scripts and am looking for some assistance to create one for my base. I thought that I could just utilize automations to update records but I have had no luck getting those to work properly and after searching through this forum I believe a script is necessary to do what I need. 

I have a Daily Fieldwork form that our employees fill out each time they go to install, remove, or service some equipment. If they are installing something new they fill out the form for an "install" and it triggers an automation that successfully creates a new record in another table called "Seismographs/Instrumentation".

If they fill out the Daily Fieldwork form for anything other than a new install, they select the equipment number or "JID" that is associated with the equipment that has already been entered into the "Seismographs/Instrumentation" table and they update the information associated with that JID. I cannot figure out how to have multiple fields updated from the Daily Fieldwork form to the Seismographs/Instrumentation table based on when they have serviced it. I have tried Rollups without success and am struggling to figure out the automation update record feature. I have come to the conclusion after much headache that I think a script is necessary. Thankful for any help! I'm happy to share my base with anyone willing to take a stab at it.

2 Replies 2

Hi Karen, if I'm understanding you right I don't think you need a script or an automation

Let's say in the "Seismographs/Instrumentation" there's a record with "JID" of "1". 

Let's also assume that this record has a "Last updated" and "Serviced by" value of "1 December 2022" and "Bob"

Today, a new form is submitted where the user has selected the record with a "JID" value of "1", and the person servicing it is "Alice"

After this is done, in the "Seismographs/Instrumentation", you want the record with a "JID" value of "1" to have  a "Last updated" and "Serviced by" value of "22 December 2022" and "Alice"

If this is what you're looking for, check out this base

The idea is to use rollup fields on the "Created Time" fields to get the latest update for each record.  From there, you then use lookup fields with a conditional to only display the latest data

Karen_Reittinge
4 - Data Explorer
4 - Data Explorer

Hi Adam,

Thanks for your reply! I'm unable to view the formulas in that base but I have gotten the Rollups on my base to work now in a similar way to what I can see in that sample base. Now I am struggling to figure out one other issue with this setup. Sometimes our employees service a JID without changing the three fields "Date Calibrated", "Old Serial #", "New Serial #". In this instance the last three formula fields will not get updated and I cannot figure out how I should adjut that. Right now my formula for the "Most Recent Date Calibrated" field is: IF(Date={Most Recent Service Date},{Date Calibrated})

Here is a link to the Daily Fieldwork table in my base that I am referring to in case that helps Daily Fieldwork