Forum Discussion

joevandervest's avatar
joevandervest
Qrew Cadet
3 years ago

New Form - Rule Trigger for Field Value Change OR accessing old value?

Context:   In old forms I had a rule that that would WRITE the old status to a log field when the user CHANGED the status of a transaction. (e.g. New to Complete, New to Hold, etc.). This was achieved by using a dynamic form rule triggered on the field value change upon SAVE. 

Additional Note: Thanks to @Mark Shnier (Your Quickbase Coach) post about "$prev." in Jinja I know we can do it there in a pipeline - but that isn't a desirable method. 

Possible Work Around in New Forms: Use the old form or create a pipeline on record save and use $prev. I tried playing around with New Forms rules formula builder - but still seem to lack a way to access the OLD Field Value and an Action trigger. 

Wasn't there some way to access an old field value within a formula so that I could use the New Form rules formula builder to create a boolean for   [Status] <> [old.Status] as a trigger? 



------------------------------
joe vandervest
------------------------------

8 Replies

  • I believe you just need to change setting of this Form Rule and un-check "Run change action when a condition changes from false to true".




    ------------------------------
    Adam Krzyzanek
    ------------------------------
    • joevandervest's avatar
      joevandervest
      Qrew Cadet

      Thanks Adam, that part would work just fine. The issue is that there DOES not appear to be a way to convert the rule below to the New Forms because it appears that there..

      • is no trigger "if the value in field x has changed"
      • is no way to access the previous value of the field if it has changed 
      It would seem that a PIPELINE is the only way to achieve this using a New Form. 


      ------------------------------
      joe vandervest
      ------------------------------
      • AdamKrzyzanek's avatar
        AdamKrzyzanek
        Qrew Captain

        Indeed for this Pipeline is an option to capture previous Status value.



        ------------------------------
        Adam Krzyzanek
        ------------------------------
  • I'm also here checking in if there is a way to perform an action with new form rules when a field's value has changed...surely there must be a way?

    • Denin's avatar
      Denin
      Qrew Captain

      Actions have been replaced with Pipelines. So if a field value changes, and you need something to happen as a result of that, you can create a Pipeline with a trigger that when a record is modified and the given field changes to a specific value then do XYZ.

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

         It is possible that you can do this with a helper field, but I have not tested. Suppose you were trying to detective on a field called. [Status]. You could create another fee field called [Previous Status].  You could initialize that field by making it a Forex field equal to the status field, but then changing it back to a scaler data entry field.  

         Then you can have a form rule that says when the record is saved, change the value of previous status to the value in the field status. You might have to have some kind of silly condition for that to trigger, which is always true.  For example, check if the record ID is not equal to 999999999999

        Then the next time you go to edit that record, you can have a form rule trigger when the [status] is not equal to the [previous status].  Of course this is not going to work in Grid Edit with the V3 Grid Reports in line editing.  

         

  • I’d also be super curious to see the full setup with some screenshots of the form. To Mark’s point, a helper field combined with two form rules could get you where you need to go. You could simulate “this field has changed” by populating a helper field under a certain condition and then comparing it to the main field in another rule to trigger the action you need.