Skip to main content

I have a list of “Hire Days” in a table. Each record has a bunch of information including the assets being used on that hire day, the staff member and the Day (as in Date) of that hire day. 

 

When a ‘new record’ is created, it want it to trigger an automation. The automation will be a script that compares the day and the asset of the new hire day record. If there is already a record with the same day AND same asset, I want the script to produce “Clash”, otherwise “No Clash”.

 

Can anyone help me?

You can create an automation that triggers when a new record is added. In the script action, loop through all existing records to check if any have the same date and asset as the new record. If a match is found, set a field to "Clash", otherwise "No Clash".

The script would basically compare the new record's date and asset fields against all other records and update a status field based on whether duplicates exist.


Hey ​@James_Henry,

I should play around with it, but there is probably a no-code approach to this. Did you try the following:
Create an Assets table (not fully needed I believe, but recommended).
Link Assets to Hire Days table. 
Create an automation: Each time a record gets created (or updated) on Hire Days, trigger the automation. Have a Search Records action on the Hire Days table to find any other record where Date = {Date} and Assets = {Assets}. 
Have Conditional Logic on your automation (two branches)
If length of records found is >1 then update the record that triggered the automation to Clash.
Otherwise, update the record that triggered the automation to No Clash.

Please feel free to grab a slot if you’d like us to go through it together! I’d be happy to help.

Mike, Consultant @ Automatic Nation


Does this look right?  If so I’ve set it up here for you to check out and you can duplicate it into your own workspace to play with it

And this is how the automation looks.  Hit me up if you have any questions!


Hi Adam,

 

Yours is the solution I tried to integrate first of all and it has worked perfectly!! Thanks a heap.

 

Some feedback, I also created 2 extra automationsL

  1. If the Asset is changed, it automatically resets the Clash Check back to blank - Meaning the user much ‘Check’ for a new clash on the new asset
  2. Same for the date. Another automation that clears the Clash Check status if the date is changed, meaning the user must do another check

 

I also added a formula convert Clash to ‼️and Blank for No Clash. I then updated the record’s name to include ‼️ at the start - so we can automatically recognise where there is a clash.

 

Im wondering if I should also have another automation. When the ‘Clash’ occurs, it obviously occurs between more than one record. Should I have something that identifies those records are also subject to a ‘Clash’… I’ll try this solution for a while and let you know.


Thanks again!

 

 

Does this look right?  If so I’ve set it up here for you to check out and you can duplicate it into your own workspace to play with it

And this is how the automation looks.  Hit me up if you have any questions!

 


Nice, glad it’s working!  Hmm what if you used a linked field for this instead?  I updated the base with this new automation (v2 - Identify clashing records) as well, and it now checks whether the autonumber is the same to prevent it from linking itself

 

 


Reply