Forum Discussion

Flo's avatar
Flo
Qrew Trainee
2 days ago
Solved

On Form Open, populate an User and Timestamp field. No way to trigger rule on Form Open?

Hi!

Use case: On opening a form (new or existing record) I want to auto-populate a field (e.g. timestamp field with now() and a user field with currentUser()) when the fields are currently empty.

I tried the following:

  1. ❌ A trigger that is just user == <other> with a blank field --> should be true on open but does not do anything
  2. ❌ A custom when formula with the content `true` --> definetly true on open, but does not do anything
  3. ❌ Record ID != -1 (also always true) does not do anything
  4. ✅ A trigger "when checkbox is checked" using a helper checkbox: As soon as user checks, checkbox, the field fills correctly. But this is not the intended behaviour
  5. 🤔 The options to change field value after save and validation also seems to work (mostly) But this is not the intended behaviour.

Any way of enabling this pattern of "fill a field when form is opened (and field is empty)" would be helpful.

  • Denin's avatar
    Denin
    2 days ago

    Just to clarify for anyone that needs help: You need to uncheck "Run change actions when a condition changes..." which will be checked by default. When you uncheck this, the rule will be applied instantly (on form open), otherwise it is only applied if a field value changes.

     

    If you wanted to run the rule only on a new form, not an edit form, you can also add a rule like if Date Created = blank, then do something combined with above.

4 Replies

  • I was able to successfully accomplish this with form rules.

    See screenshot for example for defaulting the user.  (A similar configuration works for defaulting a date field.)

    • Denin's avatar
      Denin
      Qrew Cadet

      Just to clarify for anyone that needs help: You need to uncheck "Run change actions when a condition changes..." which will be checked by default. When you uncheck this, the rule will be applied instantly (on form open), otherwise it is only applied if a field value changes.

       

      If you wanted to run the rule only on a new form, not an edit form, you can also add a rule like if Date Created = blank, then do something combined with above.

  • I'm sure we can get a form rule to work, but why not do it the more obvious way.

    Just going to field properties and set a default both of those fields.  There should be the option to respectively default to current user and default to now.

    • Flo's avatar
      Flo
      Qrew Trainee

      That only works for the first field on record creation. I have 5 user fields and timestamps for the different states of my item as it goes through manufacturing.