Scripting Data Edits
Overview
When scripting an edit to data, it is important to understand that you cannot just submit a single one time edit to the data.
This is because, the data may be refreshed after the edit has been made. For example, the data may be set to refresh itself on
a pre-specified frequency.
This means that the user must submit a function which can make the necessary updates to the data anytime it is refreshed. This is accomplisehd
by calling the transform method on the
global data cache.
In the following code, a transformation is applied to the dataset with the name "data". It filters the data for
records where the age property is greater than 20. The transformation is applied to the data immediately, and whenever the
dataset is updated.
$val.transform('data', data=>data.filter(p=>p.age>20));