How to reset fields using record rules AFTER A DELAY?

Hello brains trust - hoping someone can help with this:

BACKGROUND
I have an app with a REPAIR table with a related REPAIR HISTORY table (1 to N). When updating a REPAIR, I create a related record in the REPAIR HISTORY table using a record rule. Shows what changes over time, who changed it, etc. That all works fine.

NEW CIRCUMSTANCE
Client wants to be able to attach photos (up to 3) to REPAIR HISTORY. Given my app is really updating the REPAIR table to create a REPAIR HISTORY record, those 3 photos need to be fields in REPAIR table, and then get written across into REPAIR HISTORY using a record rule. That all works fine.

WHAT DOESNT WORK
The next time the client updates that REPAIR, those photos are still in the REPAIR table and will pre-populate the fields on the update page. Which is not what they expect - they expect 3 empty fields to add new photos to history. So I am looking for a way to ERASE these images from the REPAIR table, but AFTER the related REPAIR HISTORY record has been created.

I tried using another following record rule to null out those fields, and that works, but it works FASTER than the record rule to create the REPAIR HISTORY record, and so nothing gets saved in history. It seems to me that record rules must fire concurrently, not in the order they are listed.
And deleting those 3 fields is clearly faster than creating a new record. Which brings me to my questions:

Is there a way to ensure that one record rule completes before the next commences - i.e. set some order of precedence in record rules?

or

Is there a way to null out a field when LOADING a page? This would resolve the issue because the user would see empty fields ready to accept new images

or

Any other suggestions on how I might make the above scenario work? Maybe a code snippet to set the fields to null on page load?

regards

Leigh

I can’t offer a code snippet as I’m not a coder :man_technologist:However, you could use Make to set the image fields to “null” when you update the repair.
If I understand your process you correctly, you’re updating the repair and inserting a connected record to the repair history.
You could use the form submission for the repair update to trigger the Make scenario and set the image fields to “null” so they will be blank the next time they update the repair.
I’m sure there is a JavaScript method that one of the code guys could offer. If not, Make offers a simple no code solution.
If you need help setting this up then drop me a DM. :sunglasses:

Thanks Carl. That idea, using Make or Zapier to update the record after a short delay, is my fall back position. So far I’ve managed to avoid using external software in this client site, and hoping that there might be a more self contained way to do it.

1 Like

I think my best option is to clear any stored images on view render, but I dont know how to do that with image field types. Iv opened another topic requesting help with that … lets see if I get an answer.

1 Like