How to detect change of field value but not when changed from blank

I was hoping for a built functionality for this, but the only method I could come up with is to use UI only field to keep track of the prior value.

Any suggestions for built functionality?

Not sure if it fits your use case, but I have done a thing where I load in two Identical models on page load. At page load, they contain exactly the same info (obviously). Then you attach your components to Model 2 and put a Model Lookup UI only field on Model 2 that looks up the value from Model 1. Then compare the value from Model 1 to Model 2 in a UI only field called “Change Indicator”.

Close but not quite. I’m creating a new record and need detect the change of a previously selected lookup ID.

If in the same action sequence, you could probably use input. Otherwise, I think your original plan is the way I would go.

Action Sequences — Skuid v15.3.7 Documentation

This doesn’t give access to the prior value though. I need to know what this is. Only I know how is to keep track of it with a UI only field. I’m surprised there isn’t merge syntax for row prior values.

Oh, you are saying that the field was changed at some point in the past and you need to get its prior value? I think you would have to use field history tracking on that field in salesforce. Then, I believe you can grab it from ObjectName Histories from the API when you are setting your model object.

Nope. Newly created record where user selected a value, then goes back and changes it before saving.

What about a model action that every time that field is updated it creates a new row in a ui only model that stores that value. The. Reference the previous row to get your previous value

1 Like

I did so the using a ui only field.

I’d imagine that SKUID does have some sort of a notion of “value before” because when you hit a cancel button on a field editor / table, it returns all the values back to what they were prior to editing; though this is probably buried somewhere very deep in the javascript (certainly not accessible via the GUI), and it would only include the value prior to any changes being made, not necessarily the prior value to the last edit.

I used to see it in the skuid model in version 1. Can’t find it in version 2. Anybody know where it is?

I do see it in the model under _eventData.row.updated.oldValues and _eventData.row.updated.row for the current values. Question is how to get access without javascript. Is there a way through merge syntax?

No clue on this one but have you tried {{$Model.MODELNAME.data.ROWNUM.updated.oldValues.FIELD}} ?

No dice with either of the following:
{{$Model.NewOrder.data.0.updated.oldValues.Price_Book__c}}
{{$Model.NewOrder.data.0.oldValues.Price_Book__c}}