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:
- other than the one just updated,
- sharing the same "_plact_asset_"
- 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,