Help

Re: Untick checkbox of related record

Solved
Jump to Solution
2514 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Marc_Torra
5 - Automation Enthusiast
5 - Automation Enthusiast

I have a table with a field called "plact_is_main_activity"

Only one record for all the records sharing the same "_plact_asset_" can be "plact_is_main_activity"=TRUE

So I have set an automation triggered when "plact_is_main_activity" is updated.

When triggered, I need the automation to search which is the record:

  1. other than the one just updated,
  2. sharing the same "_plact_asset_"
  3. that has "plact_is_main_activity"=TRUE

and for that record, make "plact_is_main_activity"=FALSE

This is, I need a switcher between records sharing the same asset in such a way that only one can be "plact_is_main_activity"=TRUE.

In the attached image, if record #2 was turned into the main activity by ticking on "plact_is_main_activity", the automation would need to untick "plact_is_main_activity" for record #1 rather than leaving both ticked.

I have not managed to do it with an automation that updates records when triggered, so I would appreciate any tips on how this could be done either by triggering a script or in any other possible way.

Thanks,

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Instead of using a "when updated" trigger, use a "when record meets conditions" trigger based on when the checkbox is selected.

Then perform a "find records" action to search for the previous record that was checked using the three conditions that you indicated.
Then have a condition based on whether or not the "find records" action identified a record, and have an "update record" action to clear the checkbox of the found record.

Note that the "update record" action can only use the results of the "find records" action if exactly one record was found. However, in this case, only one record should be found, so you should be fine.

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Instead of using a "when updated" trigger, use a "when record meets conditions" trigger based on when the checkbox is selected.

Then perform a "find records" action to search for the previous record that was checked using the three conditions that you indicated.
Then have a condition based on whether or not the "find records" action identified a record, and have an "update record" action to clear the checkbox of the found record.

Note that the "update record" action can only use the results of the "find records" action if exactly one record was found. However, in this case, only one record should be found, so you should be fine.

@kuovonne it works! thank you so much!