Skip to main content
Solved

Script + Automation to automaticlaly set another field to 30mins after another field


Forum|alt.badge.img+2

Hello,

on calender view i want to default to 30 min records shown on calender at present it is 60 mins by default.

I have been trying to create a script and automation that will fill an end date and time field automatically to 30 mins after the appointment date field has been updated and then using thsi end date and time field to set this as the end of the appointment

ANyone any ideas how to do this??

 

 

Best answer by TimBeeston

Hi ​@Ireland12345,

You can achieve this with a formula field and a simple update record automation, rather than going down the script route.

  1. Create a formula field “End Calculation”, with the following formula: DATEADD({Appointment Date}, 30, 'minutes'). In the field’s formatting tab, be sure to turn off “Use the same time zone for all collaborators”
  2. Create a “When record is updated” automation to trigger when your Appointment Date field is updated. Have an update record step that sets your End Time field to your End Calculation value. 

This way allows you to manually alter your end time, if you need to the flexibility for your appointments to be longer than 30 min. If you don’t and they will all always be 30 minutes, you can do without the automation altogether and just use step one & have a calculated End Time.

 

Tm

 

View original
Did this topic help you find an answer to your question?

6 replies

TimBeeston
Forum|alt.badge.img+3
  • Participating Frequently
  • 18 replies
  • Answer
  • April 1, 2025

Hi ​@Ireland12345,

You can achieve this with a formula field and a simple update record automation, rather than going down the script route.

  1. Create a formula field “End Calculation”, with the following formula: DATEADD({Appointment Date}, 30, 'minutes'). In the field’s formatting tab, be sure to turn off “Use the same time zone for all collaborators”
  2. Create a “When record is updated” automation to trigger when your Appointment Date field is updated. Have an update record step that sets your End Time field to your End Calculation value. 

This way allows you to manually alter your end time, if you need to the flexibility for your appointments to be longer than 30 min. If you don’t and they will all always be 30 minutes, you can do without the automation altogether and just use step one & have a calculated End Time.

 

Tm

 


Mike_AutomaticN
Forum|alt.badge.img+21

Hey ​@Ireland12345,

Fully agree with ​@TimBeeston.
Please let me know if you need any help setting this up. Would love to hop on a brief call and show you around.

Mike, Consultant @ Automatic Nation  


Forum|alt.badge.img+2
  • Author
  • New Participant
  • 2 replies
  • April 1, 2025

@TimBeeston Thats great thanks very much for that works good. have been trying to use grok to help me with scripting and it wasnt working well for me.

@Mike_AutomaticN thanks for the offer, might take you up on it sometime


TimBeeston
Forum|alt.badge.img+3
  • Participating Frequently
  • 18 replies
  • April 2, 2025

@Ireland12345 - happy that’s worked.
 

Yearh, you can end up down a rabbit hole with AI. Keep in mind that even Airtable’s native AI frequently makes rudimentary formula errors. 


Forum|alt.badge.img+2
  • Author
  • New Participant
  • 2 replies
  • April 2, 2025

@TimBeeston I am having a small issue, the end date is now mixing up the months and days as in 01/07/25 turns into 07/01/25

any easy way to stop this happening.

Also is there an easy way to run this for all records just to have the, all right? at the moment it only just after i update the relevant field.

Thanks

 

 


TimBeeston
Forum|alt.badge.img+3
  • Participating Frequently
  • 18 replies
  • April 2, 2025

That will likely be due to mismatched date formats between your calc field and your end date field. Jump into the field settings and in the formatting tab make sure the that they are formatted to the same region. 


Reply