I have a field that I determined no longer needs to persist to the database. Its value was being defaulted on new edits after use in all cases so I made the decision to make it a work field.
Should the value immediately start acting as a work field? I see the old/original values being maintained from when it was a field being committed. What am I doing wrong?
Based on your subtext you define “immediately acting like” to mean “all pre-existing records get mutated to have the value removed”.
If I have understood you correctly, then no. There is no metadata change you can make that automatically adjusts pre-existing records. They had the value when they were saved, they still have the value. If you re-persist those records the work field will be removed, but not until then.
The platform feature that lets you adjust pre-existing records is a Data Transform.
1 Like
I have saved the record many times over but the old value keeps coming back. I would think after the save that the value would be empty. Is that also not the case?
@Aaron.C this might be a case that requires a data transform, and here’s why.
When we strip work fields out of the record before save, we take the entire key:value pair out of the record and then do a patch update. This means the absence of the work field in the document with a null value means the old value is never being updated to empty on save.